<template>
  <div class="table-moveset" ref="moveset">

    <div v-if="!isshow">

      <vab-query-form>
        <vab-query-form-left-panel>
          <el-button icon="el-icon-plus" type="primary" @click="handleAdd(0,'')" >
            办理入住
          </el-button>
          <el-button type="warning" @click="stamp(0)" >
            打印
          </el-button>

        </vab-query-form-left-panel>
        <vab-query-form-right-panel>
          <el-form ref="queryForm" :model="queryForm"  label-width="80px" >

              <el-date-picker
                style="width: 250px; margin-top: 10px;
                 margin-right: 12px;"
                size="mini"
                align="right"
                @change="changeTime"
                value-format="yyyy-MM-dd"
                v-model="value1"
                type="daterange"
                :unlink-panels="true"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期">
              </el-date-picker>

            <el-form-item   style="float: left;margin-top: 10px;margin-right: -40px"  label-width="46px"       size="mini">
            <el-select v-model="queryForm.checkedInStatus" placeholder="请选择">
              <el-option
                v-for="item in checkedInStatuss"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
            </el-form-item>
            <el-form-item  prop="elderlyCode" style="float: left;"  label-width="46px"       size="mini">
<!--              <el-input v-model="queryForm.elderlyCode" placeholder="老人姓名/助记码/证件号"></el-input>-->
              <el-form-item  prop="elderlyCode">
                <el-select
                  v-model="queryForm.elderlyCode"
                  filterable
                  remote
                  :clearable="true"
                  reserve-keyword
                  style="width: 100%;"
                  size="mini"
                  placeholder="请输入老人姓名/证件号/助记码"
                  :remote-method="remoteMethod"
                  :loading="loading">
                  <el-option
                    style="width: 500px"
                    v-for="item in elderlyCodes"
                    :key="item.elderlyCode"
                    :label="item.elderlyName"
                    :value="item.elderlyCode">
                    <span style="float: left;width: 24%" v-if="elderlyCodes">姓名：{{ item.elderlyName }}</span>
                    <span style="width: 33%;color: #8492a6;font-size: 13px" >电话：{{ item.contactNumber}}</span>
                    <span style="width: 45%;float: right; color: #8492a6; font-size: 13px">证件号：{{ item.cardNo }}</span>
                  </el-option>
                </el-select>
              </el-form-item>
            </el-form-item>



          </el-form>
          <el-button size="mini" type="primary" style="float: left" @click="search(1,'')">条件查询</el-button>


        </vab-query-form-right-panel>
      </vab-query-form>
      <el-table
        ref="tableSort"
        v-loading="listLoading"
        :data="list"
        border
      >

        <el-table-column
          show-overflow-tooltip
          label="老人编号"

          prop="elderlyCode"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          prop="elderlyName"
          label="老人姓名"

        ></el-table-column>
        <el-table-column

          show-overflow-tooltip
          prop="cardNo"
          label="证件号"

        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          prop="checkInBed"
          label="楼/单元/楼层/房间/床位"
          width="180px"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          prop="checkInTypeName"
          label="入住类型"

        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          prop="nursingLevelName"
          label="护理等级"

        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          prop="contractNo"
          label="合同编号"

        ></el-table-column>
        <el-table-column  label="退住状态"   width="150px">
          <template slot-scope="scope">
            <div v-if="scope.row.retreat==false">入住中</div>
            <div v-if="scope.row.retreat==true">已退住</div>
          </template>
        </el-table-column>
        <el-table-column  label="合同到期时间"   width="150px">
          <template slot-scope="scope">
            {{scope.row.contractExpirationTime | parseTime('{y}-{m}-{d}')}}
          </template>
        </el-table-column>
        <el-table-column  label="入住日期"   width="150px">
          <template slot-scope="scope">
            {{scope.row.checkedInTime | parseTime('{y}-{m}-{d}')}}
          </template>
        </el-table-column>
        <el-table-column  label="开始计费日期"   width="150px">
          <template slot-scope="scope">
            {{scope.row.startBillingTime | parseTime('{y}-{m}-{d}')}}
          </template>
        </el-table-column>

        <el-table-column
          show-overflow-tooltip
          prop="remark"
          label="备注"

        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          label="操作"
          width="380px"
          fixed="right"
        >
          <template slot-scope="scope">
<!--            <el-button type="text"  @click="handlerevise(scope.row.id,scope.row)" >修改入住项目<i class="el-icon-edit"></i></el-button>-->
<!--            <el-button type="text"  @click="handlerevisejg(scope.row.id,scope.row)">修改入住套餐价格<i class="el-icon-edit"></i></el-button>-->
              <el-dialog
                append-to-body
                destroy-on-close
                title="绑定设备"
                :visible.sync="equipmentVisibles"
                width="600px"
              >
                <el-form ref="form" label-width="80px" >
                  <el-form-item label="设备" >
                    <el-select v-model="equipmentForm.type" placeholder="请选择设备" style="width: 100%;">
                      <el-option
                        v-for="item in typeList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="设备ID" >
                    <el-input v-model="equipmentForm.id" placeholder="请输入设备ID"></el-input>
                  </el-form-item>
                </el-form>

                <div slot="footer" class="dialog-footer">
                  <el-button @click="equipmentVisibles = false">取 消</el-button>
                  <el-button type="primary"  @click="equipmentVisibles = false">确 定</el-button>
                </div>
              </el-dialog>
            <el-button type="text"  @click="equipmentVisibles = true" v-if="!scope.row.retreat">绑定设备<i class="el-icon-mobile-phone"></i></el-button>




            <el-button type="text"  @click="handlentcinfo(scope.row.id,scope.row)" v-if="!scope.row.retreat">套餐详情<i class="el-icon-tickets"></i></el-button>
            <el-button type="text"  @click="handlenrzinfo(scope.row.id,scope.row)">入住详情 <i class="el-icon-document-copy"></i></el-button>
            <el-button type="text"   @click="replacemeal(scope.row.id,scope.row)"  v-if="!scope.row.retreat">更换入住套餐<i class="el-icon-s-help"></i></el-button>
            <el-button type="text"  @click="Stay(scope.row.id,scope.row)" v-if="!scope.row.retreat" >退住<i class="el-icon-sold-out"></i></el-button>

          </template>
        </el-table-column>

      </el-table>
      <div ref="print" class="mytables" id="printContent">

        <h3 style="text-align: center;">入住信息表</h3>
        <table style="width: 100%" class="mytable" cellpadding="1" cellspacing="1">
          <thead>
           <tr>
               
                <td rowspan="2" class="ttitle">日期</td>
                <td colspan="3" style="width: 20%">老人信息</td>
                <td rowspan="2" style="width: 11%">入住类型</td>
                <td rowspan="2" class="ttitle">护理等级</td>
            <td rowspan="2" class="ttitle">合同到期时间</td>
             <td rowspan="2"style="width: 11%">开始计费时间</td>
             <td colspan="2" style="width: 11%">状态</td>

              </tr>
           <tr>
                <td>姓名</td>
               <td>证件号</td>
                <td>房间</td>
              
               <td>入住时间</td>
              <td>退住时间</td>
              </tr>
          <tr>
              
               
              </tr>
          </thead>
          <tbody>
            <tr v-for="item in stamplist">
                <td style="font-size: 14px">{{new Date()| parseTime('{y}-{m}-{d}')}}</td>
                <td style="width:5%;font-size: 14px">{{item.elderlyName}}</td>
                <td style="font-size: 14px">{{item.cardNo}}</td>
                <td style="width:5%;font-size: 14px">{{item.checkInBed}}</td>
                <td style="font-size: 14px">{{item.checkInTypeName}}</td>
                <td style="font-size: 14px" >{{item.nursingLevelName}}</td>
               <td style="width:5%;font-size: 14px">{{item.contractExpirationTime}}</td>
                <td style="font-size: 14px">{{item.startBillingTime}}</td>
             <td style="font-size: 14px" ><span v-if="item.checkedInTime">{{item.checkedInTime | parseTime('{y}-{m}-{d}')}}</span></td>
                <td style="font-size: 14px" ><span v-if="item.retreatTime">{{item.retreatTime | parseTime('{y}-{m}-{d}')}}</span></td>

              

              </tr>

          </tbody>
        </table>
      </div>
      <el-pagination
        :background="background"
        :total="total"
        :page-size="queryForm.limit"
        @current-change="handleCurrentChange"
        @size-change="handleSizeChange"
      ></el-pagination>
    </div>

    <div class="step" v-if="isshow">
    <el-steps :active="active">
      <el-step title="步骤 1" description="个人信息" icon="el-icon-edit"></el-step>
      <el-step title="步骤 2" description="评估记录" icon="el-icon-edit-outline"></el-step>
      <el-step title="步骤 3" description="办理入住" icon="el-icon-office-building"></el-step>
    </el-steps>
    <div class="frist" v-if="active===1"  v-cloak>
      <el-aside style="width: 25%;
    float: right;
    margin-right: 40px;
    min-height: 860px;
    border: 1px solid #dcdfe6;
    margin-top: 40px;">
        <el-header style="text-align: center; font-size: 14px;height: 30px">

          <span>咨询记录</span>
        </el-header>
        <el-table
          class="active"
          ref="singleTable"
          :data="tableData"
          highlight-current-row
          @row-click="handleRowClick"
          @current-change="handleCurrent"
          style="width: 100%;cursor:pointer">
          <el-table-column
            property="consultantName"
            label="咨询人姓名"
            width="120"
          >
          </el-table-column>

          <el-table-column
            property="elderlyName"
            label="老人姓名"
            width="120px"
          >
          </el-table-column>

          <el-table-column

            property="consultantRelationshipName"
            label="咨询人与老人关系"
            width="200">
          </el-table-column>
          <el-table-column

            property="consultantContactNumber"
            label="联系方式"
            width="200">
          </el-table-column>
          <el-table-column
            property="elderlyGenderName"
            label="性别"
          >
          </el-table-column>
          <el-table-column
            property="elderlySelfCareName"
            label="自理情况"
          >
          </el-table-column>
        </el-table>





      </el-aside>
    <el-form ref="form" :model="form"    label-width="100px" style="padding-top:40px;width: 70%;float: left" class="form" >

      <el-row>
        <el-col :span="8">
          <el-form-item label="姓名" required>
<!--            <el-input v-model="form.elderlyName" style="width:100%" ></el-input>-->
            <template>
            <el-select
              value-key="elderlyCode"
              @change="changeelderlyCode"
              v-model="elderlyCode"
              style="width: 100%"
              allow-create
              filterable
              remote
              reserve-keyword
              placeholder="老人姓名、编号或证件号"
              :remote-method="remoteMethod"
              :loading="loading">
              <el-option
                v-for="item in elderlyCodes"
                :key="item.elderlyCode"
                :label="item.elderlyName"
                :value="item.elderlyCode">
                <div >

                </div>

                <span style="float: left;width: 24%">姓名：{{ item.elderlyName }}</span>
                <span style="width: 33%;color: #8492a6;font-size: 13px" >电话：{{ item.contactNumber}}</span>
                <span style="width: 45%;float: right; color: #8492a6; font-size: 13px">证件号：{{ item.cardNo }}</span>


              </el-option>

            </el-select>
            </template>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="曾用名" >
            <el-input v-model="form.elderlyUsedName" style="width:100%" ></el-input>

          </el-form-item>
        </el-col >
        <el-col :span="8">
          <el-form-item label="联系电话" required >
            <el-input style="width:100%" v-model="form.contactNumber"  placeholder="请输入11位手机号" maxlength="11" oninput = "value=value.replace(/[^\d]/g,'')"></el-input>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="婚姻状况" required>
            <el-select v-model="maritalStatus" placeholder="请选择" style="width: 100%" >
              <el-option
                v-for="item in maritalStatuss"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="医保编号" >
            <el-input v-model="form.medicareNumber" ></el-input>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="医疗保险类型" >
            <el-select v-model="medicalInsuranceType" placeholder="请选择" style="width:100%" >
              <el-option
                v-for="item in medicalInsuranceTypes"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="政治面貌" required>
            <el-select v-model="politicalStatus" placeholder="请选择" style="width:100%" >
              <el-option
                v-for="item in politicalStatuss"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>

          </el-form-item>
        </el-col >
        <el-col :span="8">
          <el-form-item label="国籍" required>
            <el-select v-model="nationality" placeholder="请选择" style="width:100%" >
              <el-option
                v-for="item in nationalitys"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>
            <span  v-if="disabled">{{form.nationalityName}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="民族" required>
            <el-select v-model="nation" placehsolder="请选择" style="width:100%"

            >
              <el-option
                v-for="item in nations"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="经济来源" prop="pocketbooks">
            <el-select v-model="form.pocketbook" placehsolder="请选择" style="width:100%"

            >
              <el-option
                v-for="item in pocketbooks"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="性别" prop="gender" required>
            <template >
              <el-radio v-model="radio" :label=1 >男</el-radio>
              <el-radio v-model="radio" :label=0>女</el-radio>
            </template>

          </el-form-item>
        </el-col >
      </el-row>

      <el-divider></el-divider>
      <el-row>
        <el-col :span="8">
          <el-form-item label="联系人姓名" required >
            <el-input v-model="form.emergencyContact.contactName" style="width: 100%"  @blur="phone"></el-input>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="联系电话" required >
            <el-input v-model="form.emergencyContact.contactNumber" style="width: 100%"  placeholder="请输入联系电话"  @blur="phone"></el-input>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="与老人关系" required>
            <el-select v-model="relationship" style="width: 100%" placeholder="请选择" >
              <el-option
                v-for="item in relationships"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>

          </el-form-item>
        </el-col>
      </el-row>
      <el-divider></el-divider>




      <el-row>
        <el-col :span="8">
          <el-form-item label="出生日期" required>
            <el-date-picker
              @change="changetime"
              v-model="bridth"
              type="date"
              style="width: 100%"
              value-format="yyyy-MM-dd"
              placeholder="出生日期">
            </el-date-picker>


          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="农历日期" >
            <el-date-picker

              style="width: 100%"
              v-model="form.lunarCalendarBirth"
              value-format="yyyy-MM-dd"
              type="date"
              placeholder="农历日期">
            </el-date-picker>

          </el-form-item>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="8">
          <el-form-item label="户籍所在地" required >
            <el-cascader
              size="large"
              @change="handleChanges"
              style="width: 100%"
              class="disabled"
              :options="provinceAndCity"
              v-model="selectedOptions"
            >
            </el-cascader>


          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="详细地址" required>
            <el-input v-model="form.censusAdress.xxaddress"  placeholder="请填写街道（村镇）及门牌号"  style="width: 100%"></el-input>

          </el-form-item>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="8">
          <el-form-item label="现居住地址" required>
            <el-cascader
              size="large"
              @change="handleChange"
              style="width: 100%"
              :options="provinceAndCity"
              v-model="selectedOption"
            >
            </el-cascader>



          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="详细地址" required >
            <el-input  v-model="form.liveAdress.xxaddress"    style="width: 100%" placeholder="请填写街道（村镇）及门牌号"  ></el-input>

          </el-form-item>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="8">
          <el-form-item label="证件类型" required>
            <el-select v-model="value" placeholder="请选择"   style="width:100%">
              <el-option

                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="证件号" required>
            <el-input v-model="form.cardNo"   style="width:100%" ></el-input>

          </el-form-item>
        </el-col>
      </el-row>

      <el-divider></el-divider>
      <el-row>


        <el-col :span="8">
          <el-form-item label="习惯就医方式" required class="font">
            <el-select v-model="form.habitHospitalWay" style="width: 100%" placeholder="请选择" v-if="!disabled">
              <el-option
                v-for="item in habitHospitalWays"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>
            <span  v-if="disabled">{{form.habitHospitalWayName}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="习惯就医地点">
            <el-input v-model="form.habitHospitalSite"   style="width:100%" ></el-input>

          </el-form-item>
        </el-col>
      </el-row>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="8">
          <el-form-item label="老人类型" required>
            <el-select v-model="elderlyType" placeholder="请选择"  style="width:100%" >
              <el-option

                v-for="item in elderlyTypes"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>

            </el-select>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="文化程度" required >
            <el-select v-model="educationLevel" placeholder="请选择"  style="width:100%"  >
              <el-option

                v-for="item in educationLevels"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="宗教信仰" required>
            <el-select v-model="religiousBelief" placeholder="请选择"     style="width: 100%"  >
              <el-option

                v-for="item in religiousBeliefs"
                :key="item.dcNo"
                :label="item.name"
                :value="item.dcNo">
              </el-option>
            </el-select>

          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="购买保险" required>
            <el-select v-model="purchaseInsurance" placeholder="请选择"  style="width: 100%" >
              <el-option

                v-for="item in purchaseInsurances"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>

            </el-select>



          </el-form-item>
        </el-col>
          <el-col :span="8">

            <el-form-item label="残疾证" required>
              <el-select v-model="form.haveCertificate" placeholder="请选择"  style="width: 100%" v-if="!disabled">
                <el-option

                  v-for="item in haveCertificates"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>

              </el-select>


              <span  v-if="disabled">

              <span  v-if="form.haveCertificate==false">否</span>
               <span  v-if="form.haveCertificate==true">是</span>
          </span>
            </el-form-item>
          </el-col>

      </el-row>

    </el-form>
    </div>
    <div class="assess" v-if="active===2"  v-cloak >
      <div v-if="!isassessmentform" v-cloak>
      <el-steps direction="vertical" :actives="actives" style="display: none"  v-cloak>
        <el-step title="评估信息"></el-step>
        <el-step title="日常生活"></el-step>
        <el-step title="精神状态" ></el-step>
        <el-step title="感知觉" ></el-step>
      </el-steps>
      <div class="color" v-if="actives===1"  v-cloak style="width: 600px;margin: 50px auto">
        <h4>评估信息</h4>
        <el-form ref="Assessmentinformation" :model="Assessmentinformation"    label-width="100px" style="margin-bottom: 50px;
    border: 1px solid #ccc;color:black;
    padding: 20px 20px;" class="form" >



          <el-form-item label="姓名" required>
            <!--                            <el-input v-model="form.elderlyName" style="width:100%" ></el-input>-->
            <span>{{Assessmentinformation.elderlyName}}</span>
          </el-form-item>
          <el-form-item label="住址" required>
            <el-cascader
              size="large"
              style="width: 100%"
              :options="provinceAndCity"
              v-model="selectedOption"
            >
            </el-cascader>



          </el-form-item>
          <el-form-item label="详细地址" required >
            <el-input  v-model="Assessmentinformation.liveAdress.xxaddress"    style="width: 100%" placeholder="请填写街道（村镇）及门牌号"  ></el-input>

          </el-form-item>
          <el-form-item label="评估日期" required>
            <el-date-picker
              v-model="Assessmentinformation.evaluationDate"
              type="date"
              style="width: 100%"

              placeholder="评估日期">
            </el-date-picker>


          </el-form-item>
          <el-form-item label="评估类别" prop="evaluationType">
            <el-radio-group v-model="Assessmentinformation.evaluationType">
              <el-radio :label='1' >首次评估</el-radio>
              <el-radio :label='2' :disabled="true">持续评估</el-radio>
              <el-radio :label='3' :disabled="true">复核评估</el-radio>
            </el-radio-group>


          </el-form-item>
          <el-form-item label="评估员" prop="radio">
            <el-select v-model="Assessmentinformation.evaluationor" placeholder="请选择" style="width:100%">
              <el-option
                v-for="item in evaluationors"
                :key="item.uname"
                :label="item.userName"
                :value="item.uname">
              </el-option>
            </el-select>


          </el-form-item>

        </el-form >

      </div>
      <div class="color" v-if="actives===2"  v-cloak style="width: 900px;margin: 50px auto">


        <h4>
          一. 日常生活活动评估
        </h4>

        <el-form class="assessmentform" ref="assessmentform" :model="assessmentform" :rules="planRules" label-width="120px" label-position="top" style="margin-bottom: 50px">

          <el-form-item label="进食" prop="eatScore" key="1">
            <div class="tips"><div>说明：指用餐具将食物由容器送到口中、咀嚼、吞咽等过程</div></div>
            <el-radio-group v-model="assessmentform.eatScore" @change="checkChange">
              <el-radio :label="10" ><span class="right">10分</span>可独立进食（在合理的时间内独立进食准备好的食物）</el-radio>
              <el-radio :label="5"><span>5分</span>需部分帮助（在进食过程中需要一定的帮助，如协助把持餐具）</el-radio>
              <el-radio :label="0"><span>0分</span>需极大帮助或完全依赖他人，或有留置营养</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="洗澡" prop="laveScore" key="2">
            <el-radio-group v-model="assessmentform.laveScore" @change="checkChange">
              <el-radio :label="5"><span>5分</span>准备好洗澡水后，可独立完成洗澡过程</el-radio>
              <el-radio :label="0"><span>0分</span>在洗澡过程中需要他人帮助</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="修饰" prop="decorateScore" key="3">
            <div class="tips"><div>说明：指洗脸、刷牙、梳头、刮脸等</div></div>
            <el-radio-group v-model="assessmentform.decorateScore" @change="checkChange">

              <el-radio :label="5"><span>5分</span>可独立完成</el-radio>
              <el-radio :label="0"><span>0分</span>需要他人帮助</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="穿衣" prop="gardScore" key="4">
            <div class="tips"><div>说明：指穿衣脱衣、系扣、拉拉链、穿脱鞋袜、系鞋带等</div></div>
            <el-radio-group v-model="assessmentform.gardScore" @change="checkChange">
              <el-radio :label="10"><span class="right">10分</span>可独立完成</el-radio>
              <el-radio :label="5"><span>5分</span>需要部分帮助（能自己穿脱，但需要他人帮助整理自己的衣物、系鞋带、拉拉链）</el-radio>
              <el-radio :label="0"><span>0分</span>需极大的帮助或完全依赖他人</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="大便控制" prop="stoolScore" key="5">

            <el-radio-group v-model="assessmentform.stoolScore" @change="checkChange">
              <el-radio :label="10"><span class="right" >10分</span>可控制大便</el-radio>
              <el-radio :label="5"><span>5分</span>偶尔失控（每周<1次），或需要他人提示</el-radio>
              <el-radio :label="0"><span>0分</span>完全失控</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="小便控制" prop="urineScore" key="6">

            <el-radio-group v-model="assessmentform.urineScore" @change="checkChange">
              <el-radio :label="10"><span class="right">10分</span>可控制小便</el-radio>
              <el-radio :label="5"><span>5分</span>偶尔失控（每周<1次），或需要他人提示</el-radio>
              <el-radio :label="0"><span>0分</span>完全失控</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="如厕" prop="goToiletScore" key="7">
            <div class="tips"><div>说明：包括去厕所、解开衣裤、擦净、整理衣裤、冲水等</div></div>
            <el-radio-group v-model="assessmentform.goToiletScore" @change="checkChange">
              <el-radio :label="10"><span class="right">10分</span>可独立完成</el-radio>
              <el-radio :label="5"><span>5分</span>需部分帮助（需他人搀扶去厕所、需他人帮忙冲水或整理衣裤等）</el-radio>
              <el-radio :label="0"><span>0分</span>需极大帮助或完全依赖他人</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="床椅转移" prop="bedChairTransferScore" key="8">
            <div class="tips"><div>说明：包括去厕所、解开衣裤、擦净、整理衣裤、冲水等</div></div>
            <el-radio-group v-model="assessmentform.bedChairTransferScore" @change="checkChange">
              <el-radio :label="15"><span class="right">15分</span>可独立完成</el-radio>
              <el-radio :label="10"><span class="right">10分</span>需部分帮助（需他人搀扶或使用拐杖）</el-radio>
              <el-radio :label="5"><span>5分</span>需极大帮助（较大程度上依赖他人搀扶和帮助）</el-radio>
              <el-radio :label="0"><span>0分</span>完全依赖他人</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="平地行走" prop="walkingOnFlatGroundScore" key="9">
            <el-radio-group v-model="assessmentform.walkingOnFlatGroundScore" @change="checkChange">
              <el-radio :label="15"><span class="right">15分</span>可独立在平地上行走45m</el-radio>
              <el-radio :label="10"><span class="right">10分</span>需部分帮助（因肢体残疾、平衡能力差、过度衰弱、视力等问题，在一定程度上需他人地搀扶或使用拐杖、助行器等辅助用具）</el-radio>
              <el-radio :label="5"><span>5分</span>需极大帮助（因肢体残疾、平衡能力差、过度衰弱、视力等问题，在较大程度上依赖他人搀扶，或坐在轮椅上自行移动）</el-radio>
              <el-radio :label="0"><span>0分</span>完全依赖他人</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="上下楼梯" prop="downStairsScore" key="10">
            <el-radio-group v-model="assessmentform.downStairsScore" @change="checkChange">
              <el-radio :label="10"><span class="right">10分</span>可独立上下楼梯（连续上下10-15个台阶）</el-radio>
              <el-radio :label="5"><span>5分</span>需部分帮助（需他人搀扶，或扶着楼梯、使用拐杖等）</el-radio>
              <el-radio :label="0"><span>0分</span>需极大帮助或完全依赖他人</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="日常生活活动总分" >
            <div class="tips"  ><div>{{fraction}}分</div></div>
          </el-form-item>
          <el-form-item label="日常生活活动分级"  prop="grade" @change="checkChange">
            <el-radio-group v-model="assessmentform.grade" :disabled="true">
              <el-radio :label="0">0 能力完好：总分100分</el-radio>
              <el-radio :label="1">1 轻度受损：总分65-95分</el-radio>
              <el-radio :label="2">2 中度受损：总分45-60分</el-radio>
              <el-radio :label="3">3 重度受损：总分≤40分</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>





      </div>
      <div class="color" v-if="actives===3"  v-cloak style="width: 900px;margin: 50px auto">


        <h4>
          二.精神状态评估表
        </h4>

        <el-form class="assessmentform" ref="spirit" :model="spirit"  :rules="spiritRules" label-width="120px" label-position="top" style="margin-bottom: 50px">

          <el-form-item label="认知功能" prop="cognitiveAbilityScore" key="11" >
            <div class="tips"><div>“我说三样东西，请重复一遍，并记住，一会儿会问您”：苹果、手表、国旗</div></div>
            <div class="tips"><div>（1）画钟实验：“请您在这儿画一个圆形的时钟，在时钟上标出10点45分”</div></div>
            <div class="tips"><div>（2）回忆词语：“现在请您告诉我，刚才我要您记住的三样东西是什么？”
            </div>
            </div>
            <div class="tips"><div>评分</div></div>
            <el-radio-group v-model="spirit.cognitiveAbilityScore"  @change="checkChangespirit">
              <el-radio :label="2"><span>2分</span>已确诊为认知障碍，如老年痴呆</el-radio>
              <el-radio :label="1"><span>1分</span>画钟错误（画的圆不闭锁，或指针位置不准确），或只回忆出0-1个词</el-radio>
              <el-radio :label="0"><span>0分</span>画钟正确（画出一个闭锁圆，指针位置准确），且能回忆出2-3个词</el-radio>
            </el-radio-group>

          </el-form-item>
          <el-form-item label="攻击行为" prop="aggressiveBehaviorScore" key="12">
            <el-radio-group v-model="spirit.aggressiveBehaviorScore"  @change="checkChangespirit">
              <el-radio :label="2"><span>2分</span>每周有几次身体攻击行为，或每日有语言攻击行为</el-radio>
              <el-radio :label="1"><span>1分</span>每月有几次身体攻击行为，或每周有几次语言攻击行为</el-radio>
              <el-radio :label="0"><span>0分</span>无身体攻击行为（如打/踢/推/咬/抓/摔东西）和语言攻击行为（如骂人、语言威胁、尖叫）</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="抑郁症状" prop="depressionSymptomsScore" key="13">
            <el-radio-group v-model="spirit.depressionSymptomsScore"  @change="checkChangespirit">
              <el-radio :label="2"><span>2分</span>有自杀念头或自杀行为</el-radio>
              <el-radio :label="1"><span>1分</span>情绪低落、不爱说话、不爱梳洗、不爱活动</el-radio>
              <el-radio :label="0"><span>0分</span>无</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="精神状态总分" >
            <div class="tips" ><div>{{spiritfraction}}分</div></div>
          </el-form-item>
          <el-form-item label="精神状态分级"  prop="grade" @change="checkChangespirit">
            <el-radio-group v-model="spirit.grade" :disabled="true">
              <el-radio :label="0">0 能力完好：总分0分</el-radio>
              <el-radio :label="1">1 轻度受损：总分1分</el-radio>
              <el-radio :label="2">2 中度受损：总分2-3分</el-radio>
              <el-radio :label="3">3 重度受损：总分4-6分</el-radio>
            </el-radio-group>
          </el-form-item>

        </el-form>





      </div>
      <div class="color" v-if="actives===4"  v-cloak style="width: 900px;margin: 50px auto">
        <h4>
          三.感知觉与沟通评估表
        </h4>

        <el-form class="assessmentform" ref="perception" :model="perception" :rules="perceptionRules" label-width="120px" label-position="top" style="margin-bottom: 50px">

          <el-form-item label="意识水平" prop="levelOfConsciousnessScore" key="14">

            <el-radio-group v-model="perception.levelOfConsciousnessScore"  @change="checkChangeperception">
              <el-radio :label="3" ><span>3分</span>昏迷，处于浅昏迷时对疼痛刺激有回避和痛苦表情；处于深昏迷时对刺激无反应
                <div  class="tips" style="margin-left: 55px">（若评定为昏迷，直接评定为重度失能，可不进行以下项目的评估）</div>
              </el-radio>
              <el-radio :label="2"><span>2分</span>昏睡，一般的外界刺激不能使其觉醒，给予较强烈的刺激时可有短时的意识清醒，醒后可简短回答提问，
                <div  class="tips" style="margin-left: 65px">当刺激减弱后又很快进入睡眠状态</div>
              </el-radio>
              <el-radio :label="1"><span>1分</span>嗜睡，表现为睡眠状态过度延长。当呼唤或推动其肢体时可唤醒，并能进行正确的交谈或执行指令，停止刺激后又继续入睡</el-radio>
              <el-radio :label="0"><span>0分</span>神志清醒，对周围环境警觉</el-radio>
            </el-radio-group>

          </el-form-item>
          <el-form-item label="视力" prop="visionScore" key="15">
            <div class="tips"><div>说明:若平日带老花镜或近视镜，应在佩戴眼镜的情况下评估

            </div></div>
            <el-radio-group v-model="perception.visionScore"  @change="checkChangeperception">
              <el-radio :label="4"><span>4分</span>没有视力，眼睛不能跟随物体移动</el-radio>
              <el-radio :label="3"><span>3分</span>辨认物体有困难，但眼睛能跟随物体移动，只能看到光、颜色和形状</el-radio>
              <el-radio :label="2"><span>2分</span>视力有限，看不清报纸大标题，但能辨认物体</el-radio>
              <el-radio :label="1"><span>1分</span>能看清楚大字体，但看不清书报上的标准字体</el-radio>
              <el-radio :label="0"><span>0分</span>能看清书报上的标准字体</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="听力" prop="hearingScore" key="16">
            <div class="tips"><div>说明:若平时佩戴助听器，应在佩戴助听器的情况下评估
            </div></div>
            <el-radio-group v-model="perception.hearingScore"  @change="checkChangeperception">
              <el-radio :label="4"><span>4分</span>完全听不见</el-radio>
              <el-radio :label="3"><span>3分</span>讲话者大声说话或说话很慢，才能部分听见</el-radio>
              <el-radio :label="2"><span>2分</span>正常交流有些困难，需在安静的环静或大声说话才能听到</el-radio>
              <el-radio :label="1"><span>1分</span>在轻声说话或说话距离超过2米时听不清</el-radio>
              <el-radio :label="0"><span>0分</span>可正常交谈，能听到电视、电话、门铃的声音</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="沟通交流" prop="communicationScore" key="17">
            <div class="tips"><div>说明:包括非语言沟通

            </div></div>
            <el-radio-group v-model="perception.communicationScore"  @change="checkChangeperception">
              <el-radio :label="3"><span>3分</span>不能表达需要或理解他人的话</el-radio>
              <el-radio :label="2"><span>2分</span>表达需要或理解有困难，需频繁重复或简化口头表达</el-radio>
              <el-radio :label="1"><span>1分</span>能够表达自己的需要及理解别人的话，但需要增加时间或给予帮助</el-radio>
              <el-radio :label="0"><span>0分</span>无困难，能与他人正常沟通和交流</el-radio>
            </el-radio-group>
          </el-form-item>

          <el-form-item label="感知觉与沟通分级"  prop="grade" @change="checkChangeperception" key="18">
            <el-radio-group v-model="perception.grade" :disabled="true">
              <el-radio :label="0">0 能力完好：意识清醒，且视力和听力评为0或1，沟通评为0
              </el-radio>
              <el-radio :label="1">1 轻度受损：意识清醒，但视力或听力中至少一项评为2，或沟通评为1
              </el-radio>
              <el-radio :label="2">2 中度受损：意识清醒，但视力或听力中至少一项评为3，或沟通评为2
              </el-radio>
              <el-radio :label="3">3 重度受损：意识清醒或嗜睡，但视力或听力中至少一项评为4，或沟通评为3；或昏睡/昏迷</el-radio>
            </el-radio-group>
          </el-form-item>

        </el-form>





      </div>
      <div class="color" v-if="actives===5"  v-cloak style="width: 900px;margin: 50px auto">

        <h4>
          四.社会参与评估表
        </h4>

        <el-form class="assessmentform" ref="society" :rules="societyRules" :model="society"  label-width="120px" label-position="top" style="margin-bottom: 50px">

          <el-form-item label="生活能力" prop="survivalSkillsScore" key="19">

            <el-radio-group v-model="society.survivalSkillsScore"  @change="checkChangesociety">
              <el-radio :label="4" ><span>4分</span>个人基本生活事务（如饮食、二便）需要部分帮助或完全依赖他人帮助

              </el-radio>
              <el-radio :label="3" ><span>3分</span>个人基本生活事务能自理（如饮食、二便），在督促下可洗漱

              </el-radio>
              <el-radio :label="2"><span>2分</span>个人生活能自理；只有在他人帮助下才能做些家务，但质量不好

              </el-radio>
              <el-radio :label="1"><span>1分</span>除个人生活自理外，只能做简单的家务（如洗碗、叠被、整理衣物等），家庭事务安排欠条理。</el-radio>
              <el-radio :label="0"><span>0分</span>除个人生活自理外（如饮食、洗漱、穿戴、二便），能料理家务（如做饭、洗衣、擦玻璃、铺床等）或当家管理事务 <div  class="tips" style="margin-left: 65px">（如钱财管理）。</div></el-radio>
            </el-radio-group>

          </el-form-item>
          <el-form-item label="工作能力" prop="abilityToWorkScore" key="20">
            <el-radio-group v-model="society.abilityToWorkScore"  @change="checkChangesociety">
              <el-radio :label="4"><span>4分</span>对以往的知识或技能全部磨灭</el-radio>
              <el-radio :label="3"><span>3分</span>对熟练工作只有一些片段保留，技能全部遗忘</el-radio>
              <el-radio :label="2"><span>2分</span>原来熟练的脑力工作或体力技巧性工作明显不如以往，部分遗忘</el-radio>
              <el-radio :label="1"><span>1分</span>原来熟练的脑力工作或体力技巧性工作能力有所下降</el-radio>
              <el-radio :label="0"><span>0分</span>原来熟练的脑力工作或体力技巧性工作可照常进行</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="时间/空间定向" prop="spatialOrientationScore" key="21">
            <el-radio-group v-model="society.spatialOrientationScore"  @change="checkChangesociety">
              <el-radio :label="4"><span>4分</span>无时间观念；不能单独外出</el-radio>
              <el-radio :label="3"><span>3分</span>时间观念很差，年、月、日不清楚，可知上午或下午；只能在左邻右舍间串门，对现住地不知名称和方位</el-radio>
              <el-radio :label="2"><span>2分</span>时间观念较差，年、月、日不清楚，可知上半年或下半年；只能单独在家附近行动，对现住地只知名称，不知道方位</el-radio>
              <el-radio :label="1"><span>1分</span>时间观念有些下降，年、月、日清楚，但有时相差几天；可单独来往于近街，知道现住地的名称和方位，但不知回家路线</el-radio>
              <el-radio :label="0"><span>0分</span>时间观念（年、月、日、时）清楚；可单独出远门，可自行熟练使用大众交通工具（乘坐火车、公交、地铁等）、能很快
                <div  class="tips" style="margin-left: 65px">掌握新环境的方位</div>  </el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="人物定向" prop="characterOrientationScore" key="22">
            <el-radio-group v-model="society.characterOrientationScore"  @change="checkChangesociety">
              <el-radio :label="4"><span>4分</span>不辨熟人和生人</el-radio>
              <el-radio :label="3"><span>3分</span>只认识常同住的亲人和经常接触的服务人员，可称呼子女或孙子女，可辨熟人和生人</el-radio>
              <el-radio :label="2"><span>2分</span>能称呼家中人，或只能照样称呼，不知其关系，不辨辈分</el-radio>
              <el-radio :label="1"><span>1分</span>知道家中近亲的关系，可识别经常接触的服务人员（医务人员、社工、护理员等），不会分辨陌生人的大致年龄，
                <div  class="tips" style="margin-left: 65px">不能称呼陌生人</div> </el-radio>
              <el-radio :label="0"><span>0分</span>知道周围人们的关系，知道常见人物称谓的意义(如祖孙、叔伯、姑姨、婆媳等)；可分辨陌生人的大致年龄和身份，
                <div  class="tips" style="margin-left: 65px">可用适当称呼</div></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="社会交往能力" prop="socialSkillsScore" key="23">
            <el-radio-group v-model="society.socialSkillsScore"  @change="checkChangesociety">
              <el-radio :label="4"><span>4分</span>难以与人接触</el-radio>
              <el-radio :label="3"><span>3分</span>勉强可与人交往，谈吐内容不清楚，表情不恰当</el-radio>
              <el-radio :label="2"><span>2分</span>脱离社会，可被动接触，不会主动待人，谈话中很多不适词句，容易上当受骗</el-radio>
              <el-radio :label="1"><span>1分</span>能适应单纯环境（如社区日间照料中心、养老机构内环境等），主动接触人，初见面时难让人发现智力问题，不能理解隐喻语</el-radio>
              <el-radio :label="0"><span>0分</span>参与社会，在社会环境有一定的适应能力，待人接物恰当</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="社会参与总分" >
            <div class="tips"  ><div>{{societyfraction}}分</div></div>
          </el-form-item>
          <el-form-item label="社会参与分级"  prop="grade" @change="checkChange">
            <el-radio-group v-model="society.grade" :disabled="true">
              <el-radio :label="0">0 能力完好：总分0-2分</el-radio>
              <el-radio :label="1">1 轻度受损：总分3-7分</el-radio>
              <el-radio :label="2">2 中度受损：总分8-13分</el-radio>
              <el-radio :label="3">3 重度受损：总分14-20分</el-radio>
            </el-radio-group>
          </el-form-item>

        </el-form>





      </div>
      <div class="color" v-if="actives===6"  v-cloak style="width: 900px;margin: 50px auto">
        <h2 style="text-align: center">
          老年人自理能力评估报告
        </h2>
        <el-form class="assessmentform" :model="ability"  label-width="120px" label-position="top" style="margin-bottom: 50px">

          <el-form-item label="一级指标分级">
            <span >日常生活活动  <span style="color: #1386d2">{{ability.adAssessmentGrade}} 级</span></span></br>
            <span>精神状态 <span style="color: #1386d2">{{ability.msAssessmentGrade	}} 级</span></span></br>
            <span>感知觉与沟通 <span style="color: #1386d2">{{ability.pcAssessmentGrade}} 级</span></span></br>
            <span>社会参与 <span style="color: #1386d2">{{ability.spAssessmentGrade	}} 级</span></span>


          </el-form-item>
          <el-form-item label="老年人能力初步等级" prop="abilityInitialLevel">
            <el-radio-group v-model="ability.abilityInitialLevel" >
              <el-radio :label="3"  :disabled="true"><span class="right">3 重度失能</span></el-radio>
              <el-radio :label="2" :disabled="true"><span>2 中度失能</span></el-radio>
              <el-radio :label="1" :disabled="true"><span>1 轻度失能</span></el-radio>
              <el-radio :label="0" :disabled="true"><span>0 能力完好</span></el-radio>
            </el-radio-group>

          </el-form-item>
          <el-form-item label="等级变更条款" prop="changeClause" >
            <el-radio-group v-model="ability.changeClause[0]" @change="changeClause" >
              <el-radio :label="1" :disabled="isdisabled" ><span class="right">1 有认知障碍/痴呆、精神疾病者，在原有能力级别上提高一个等级；
</span></el-radio>
              <el-radio :label="2" :disabled="isdisabled"><span>2 近30天内发生过2次及以上跌倒、噎食、自杀、走失者，在原有能力级别上提高一个等级；</span></el-radio>
              <el-radio :label="3" :disabled="isdisabled"><span>3 处于昏迷状态者，直接评定为重度失能；</span></el-radio>
              <el-radio :label="4" :disabled="true"><span>4 若初步等级确定为“3重度失能”，则不考虑上述1-3中各情况对最终等级的影响，等级不再提高</span></el-radio>
            </el-radio-group>

          </el-form-item>
          <el-form-item label="老年人能力最终等级" prop="abilityFinalLevel">
            <el-radio-group v-model="ability.abilityFinalLevel">
              <el-radio :label="3" :disabled="true" ><span class="right">3 重度失能
</span></el-radio>
              <el-radio :label="2" :disabled="true"><span>2 中度失能</span></el-radio>
              <el-radio :label="1" :disabled="true"><span>1 轻度失能</span></el-radio>
              <el-radio :label="0" :disabled="true"><span>0 能力完好</span></el-radio>
            </el-radio-group>

          </el-form-item>
          <el-form-item>
            <div class="tips"><div>注：老年人能力初步等级划分标准</div></div>

            <div class="tips" ><div><span style="color: #333333;font-size: 14px;font-weight: bold">0 能力完好</span></div></div>
            <div class="tips" ><div>日常生活活动、精神状态、感知觉与沟通分级均为0，社会参与分级为0或1</div></div>

            <div class="tips" ><div><span style="color: #333333;font-size: 14px;font-weight: bold">1 轻度失能</span></div></div>
            <div class="tips" >
              <div>
                日常生活活动分级为0，但精神状态、感知觉与沟通中至少一项分级为1及以上，或社会参与的分级为2；
              </div>
              <div class="tips">
                或日常生活活动分级为1，精神状态、感知觉与沟通、社会参与中至少有一项的分级为0或1
              </div>
              <div class="tips" ><div><span style="color: #333333;font-size: 14px;font-weight: bold">2 中度失能</span></div></div>
              <div class="tips">
                日常生活活动分级为1，但精神状态、感知觉与沟通、社会参与均为2，或有一项为3；
              </div>
              <div class="tips">
                或日常生活活动分级为2，且精神状态、感知觉与沟通、社会参与中有1-2项的分级为1或2
              </div>
              <div class="tips" ><div><span style="color: #333333;font-size: 14px;font-weight: bold">3 重度失能</span></div></div>
              <div class="tips">
                日常生活活动的分级为3；
              </div>
              <div class="tips">
                或日常生活活动、精神状态、感知觉与沟通、社会参与分级均为2；
              </div>
              <div class="tips">
                或日常生活活动分级为2，且精神状态、感知觉与沟通、社会参与中至少有一项分级为3
              </div>
            </div>

          </el-form-item>


        </el-form>





      </div>
        <el-button style=" position: fixed;bottom: 20px; right: 220px;"   v-if="active==2 " @click="prevpage">上一页</el-button>

      <el-button style=" position: fixed;bottom: 20px; right: 120px;"   v-if="active==2" @click="nextpage">下一页</el-button>
      </div>

      <div v-if="isassessmentform" v-cloak>
        <h2 style="text-align: center">
          老年人自理能力评估报告
        </h2>
        <el-form class="assessmentform" :model="selfCareAbilityAssessmentReport"  label-width="120px" label-position="top" style="width: 900px;margin: 50px auto">

          <el-form-item label="一级指标分级">
            <span >日常生活活动  <span style="color: #1386d2">{{selfCareAbilityAssessmentReport.adAssessmentGrade}} 级</span></span></br>
            <span>精神状态 <span style="color: #1386d2">{{selfCareAbilityAssessmentReport.msAssessmentGrade	}} 级</span></span></br>
            <span>感知觉与沟通 <span style="color: #1386d2">{{selfCareAbilityAssessmentReport.pcAssessmentGrade}} 级</span></span></br>
            <span>社会参与 <span style="color: #1386d2">{{selfCareAbilityAssessmentReport.spAssessmentGrade	}} 级</span></span>


          </el-form-item>
          <el-form-item label="老年人能力初步等级" prop="abilityInitialLevel">
            <el-radio-group v-model="selfCareAbilityAssessmentReport.abilityFinalLevel" >
              <el-radio :label="3"  :disabled="true"><span class="right">3 重度失能</span></el-radio>
              <el-radio :label="2" :disabled="true"><span>2 中度失能</span></el-radio>
              <el-radio :label="1" :disabled="true"><span>1 轻度失能</span></el-radio>
              <el-radio :label="0" :disabled="true"><span>0 能力完好</span></el-radio>
            </el-radio-group>

          </el-form-item>
          <el-form-item label="等级变更条款" prop="changeClause" >
            <el-radio-group v-model="selfCareAbilityAssessmentReport.changeClause" @change="changeClause" >
              <el-radio :label="1" :disabled="true" ><span class="right">1 有认知障碍/痴呆、精神疾病者，在原有能力级别上提高一个等级；
</span></el-radio>
              <el-radio :label="2" :disabled="true"><span>2 近30天内发生过2次及以上跌倒、噎食、自杀、走失者，在原有能力级别上提高一个等级；</span></el-radio>
              <el-radio :label="3" :disabled="true"><span>3 处于昏迷状态者，直接评定为重度失能；</span></el-radio>
              <el-radio :label="4" :disabled="true"><span>4 若初步等级确定为“3重度失能”，则不考虑上述1-3中各情况对最终等级的影响，等级不再提高</span></el-radio>
            </el-radio-group>

          </el-form-item>
          <el-form-item label="老年人能力最终等级" prop="abilityFinalLevel">
            <el-radio-group v-model="selfCareAbilityAssessmentReport.abilityFinalLevel">
              <el-radio :label="3" :disabled="true" ><span class="right">3 重度失能
</span></el-radio>
              <el-radio :label="2" :disabled="true"><span>2 中度失能</span></el-radio>
              <el-radio :label="1" :disabled="true"><span>1 轻度失能</span></el-radio>
              <el-radio :label="0" :disabled="true"><span>0 能力完好</span></el-radio>
            </el-radio-group>

          </el-form-item>
          <el-form-item>
            <div class="tips"><div>注：老年人能力初步等级划分标准</div></div>

            <div class="tips" ><div><span style="color: #333333;font-size: 14px;font-weight: bold">0 能力完好</span></div></div>
            <div class="tips" ><div>日常生活活动、精神状态、感知觉与沟通分级均为0，社会参与分级为0或1</div></div>

            <div class="tips" ><div><span style="color: #333333;font-size: 14px;font-weight: bold">1 轻度失能</span></div></div>
            <div class="tips" >
              <div>
                日常生活活动分级为0，但精神状态、感知觉与沟通中至少一项分级为1及以上，或社会参与的分级为2；
              </div>
              <div class="tips">
                或日常生活活动分级为1，精神状态、感知觉与沟通、社会参与中至少有一项的分级为0或1
              </div>
              <div class="tips" ><div><span style="color: #333333;font-size: 14px;font-weight: bold">2 中度失能</span></div></div>
              <div class="tips">
                日常生活活动分级为1，但精神状态、感知觉与沟通、社会参与均为2，或有一项为3；
              </div>
              <div class="tips">
                或日常生活活动分级为2，且精神状态、感知觉与沟通、社会参与中有1-2项的分级为1或2
              </div>
              <div class="tips" ><div><span style="color: #333333;font-size: 14px;font-weight: bold">3 重度失能</span></div></div>
              <div class="tips">
                日常生活活动的分级为3；
              </div>
              <div class="tips">
                或日常生活活动、精神状态、感知觉与沟通、社会参与分级均为2；
              </div>
              <div class="tips">
                或日常生活活动分级为2，且精神状态、感知觉与沟通、社会参与中至少有一项分级为3
              </div>
            </div>

          </el-form-item>


        </el-form>
        <el-button  style=" position: fixed;bottom: 20px; right: 120px;"   type="primary" @click="clickflage&&isnext($event),clickflage&&next($event)">下一步</el-button>
        <el-button  style=" position: fixed;bottom: 20px; right: 220px;"   type="success"   @click="prev">上一步</el-button>

      </div>
    </div >

    <div class="frist" v-if="active===3"  v-cloak>




            <el-form ref="from"    :model="from"  label-width="180px"  style="margin-top: 20px;" >
              <el-row>
                <el-divider style="width: 85%;margin-left: 100px;">个人信息</el-divider>
                <el-col :span="8">
              <el-form-item label="老人姓名"  >
                <span>{{from.elderlyName}}</span>
              </el-form-item>

<!--                  <el-form-item label="机构名称" required >-->


<!--                    <span>{{from.institutionName}}</span>-->

<!--                  </el-form-item>-->
                </el-col>
              </el-row>

              <el-row>
                <el-divider>房间信息</el-divider>
                <el-col :span="8">
                  <el-form-item label="楼宇名称"  required>
                    <el-select v-model="value2"   placeholder="楼宇名称"   style="width:100% "  @change="changestor">
                      <el-option
                        style="width: 100%"
                        v-for="item in option"
                        :key="item.number"
                        :disabled="item.disabled==1"
                        :label="item.name"
                        :value="item.number">
                      </el-option>
                    </el-select>


                  </el-form-item>
                </el-col>

                <el-col :span="8">
                  <el-form-item label="房间号"  required>
                    <el-select v-model="value3"   placeholder="房间号"   style="width:100% "  @change="changesroom">
                      <el-option
                        v-for="item in room"
                        :key="item.id"

                        :label="item.roomCode"
                        :value="item.id">
                        <span style="width: 33%; float: left">{{ item.roomCode }}</span>
                        <span style=" width: 33%;float: left; color: #8492a6; font-size: 13px">{{ item.unit }}单元</span>
                        <span style="width: 33%; float: right;color: #8492a6; font-size: 13px">{{ item.floor }}楼</span>
                      </el-option>
                    </el-select>

                  </el-form-item>

                </el-col>
                <el-col :span="8">
                  <el-form-item label="床位号"  required>
                    <el-select v-model="value4" placeholder="床位号" @change="changebed">
                      <el-option
                       style="width: 100%"
                        :disabled="item.disableds"
                        v-for="item in bed"
                        :key="item.bedCode"
                        :label="item.bedCode"
                        :value="item.bedCode">
                        <span style="float: left">{{ item.bedCode }}</span>
                        <span style="float: right; color: #8492a6; font-size: 13px">{{ item.statusName }}</span>
                      </el-option>
                    </el-select>


                  </el-form-item>
                </el-col>
              </el-row>

              <el-row>
                <el-divider>入住信息</el-divider>

                <el-col :span="8">
                <el-form-item label="入住类型" required >

                  <el-select

                    v-model="checkInType"

                    style="width: 100%"
                    placeholder="入住类型">
                    <el-option
                      v-for="item in checkInTypes"
                      :key="item.typeCode"
                      :label="item.typeName"
                      :value="item.typeCode">
                    </el-option>
                  </el-select>

                </el-form-item>
                </el-col>
                <el-col :span="8">
              <el-form-item label="入住日期" prop="checkedInTime"  :rules="[
      { required: true, message: '入住日期', trigger: 'change' },
    ]">
                <el-date-picker
                  v-model="from.checkedInTime"
                  type="date"
                  style="width: 100%"
                  value-format="yyyy-MM-dd"
                  placeholder="计划入住时间">
                </el-date-picker>
              </el-form-item>
                </el-col>
                <el-col :span="8">
              <el-form-item label="是否包房" required>
                <el-select v-model="compartment" placeholder="请选择"  >
                  <el-option
                    style="width: 100%"
                    v-for="item in compartments"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>

                </el-select>

              </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-divider>合同护理信息</el-divider>
              <el-col>
                <el-col :span="8">
              <el-form-item label="合同到期时间" prop="contractExpirationTime"   :rules="[
      { required: true, message: '合同到期时间', trigger: 'change' },
    ]" >
                <el-date-picker
                  v-model="from.contractExpirationTime"
                  type="date"
                  style="width: 100%"
                  value-format="yyyy-MM-dd"
                  placeholder="合同到期时间">
                </el-date-picker>
              </el-form-item>
                </el-col>
                <el-col :span="8">
                      <el-form-item label="合同编号" prop="contractNo"  :rules="[
      { required: true, message: '合同编号', trigger: 'blur' },
    ]">
                        <el-input  v-model="from.contractNo" style="width: 100%" ></el-input>
                      </el-form-item>
                </el-col>
                <el-col :span="8">
              <el-form-item label="护理等级" required >

                <el-select

                  v-model="nursingLevel"


                  placeholder="护理等级">
                  <el-option
                    style="width: 100%"
                    v-for="item in nursingLevels"
                    :key="item.levelCode"
                    :label="item.levelName"
                    :value="item.levelCode">
                  </el-option>
                </el-select>

              </el-form-item>
                </el-col>
              </el-col>
                </el-row>

              <el-row>
                <el-divider>套餐信息</el-divider>

                <el-col>
                <el-col :span="8">
              <el-form-item label="套餐名称" required >

                <el-select

                  v-model="projectPackage"

                  style="width: 100%"
                  placeholder="套餐名称">
                  <el-option
                    v-for="item in projectPackages"
                    :key="item.mark"
                    :label="item.name"
                    :value="item.mark">
                  </el-option>
                </el-select>

              </el-form-item>
                </el-col>
                <el-col :span="8">
              <el-form-item label="开始计费日期"  prop="startBillingTime" :rules="[
      { required: true, message: '开始计费日期', trigger: 'change' },
    ]">
              <el-date-picker
                v-model="from.startBillingTime"
                type="date"
                style="width: 100%"
                value-format="yyyy-MM-dd"
                placeholder="开始计费日期">
              </el-date-picker>
              </el-form-item>
                </el-col>
              </el-col>
              </el-row>
              <el-row>
                <el-divider>备注信息</el-divider>
              <el-col>
                <el-col :span="16">

              <el-form-item label="备注信息" >
                <el-input  type="textarea" v-model="from.remark"           style="width: 100%;"></el-input>
              </el-form-item>
                </el-col>
              </el-col>

              </el-row>


            </el-form>

    </div>
    <el-button  style=" position: fixed;bottom: 20px; right: 120px;"   type="primary"  @click="clickflage&&next($event),!clickflage&&reque($event),clickflage&&addase($event)" v-if="active==1 || active==2 &&actives==6">下一步</el-button>

      <el-button  style=" position: fixed;bottom: 20px; right: 220px;"   type="success"  @click="prev" v-if=" active!=1&&active==2&&actives==1||active!=1&&active==3&&actives==1 ||  active==3 || actives==6  ">上一步</el-button>
<!--      <el-button  type="primary" @click="saveAssessment" >确 定</el-button>-->
      <el-button  type="success" style="position: fixed;bottom: 20px; right: 220px; " @click="back" v-if="active==1">取消</el-button>
      <el-button style="position: fixed;bottom: 20px; right: 120px; " type="primary" v-if="active==3" @click="commint " v-preventReClick>提交</el-button>


    </div>
    <el-dialog
      append-to-body
      destroy-on-close
      title="套餐详情"
      :visible.sync="innerVisibles"
      width="1000px"


    >
      <el-table
        class="button"
        v-loading="listLoading"
        :data="tcinfo.items"
        :span-method="objectSpanMethod"
        ref="tableSort"
      >

        <el-table-column
          show-overflow-tooltip
          label="套餐名称"
          width="150px"
          prop="name"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          prop="dailyFee"
          label="套餐日费用"
          width="150px"
        ></el-table-column>
        <el-table-column

          show-overflow-tooltip
          prop="monthFee"
          label="套餐月费用"
          width="150px"
        ></el-table-column>
        <el-table-column

          show-overflow-tooltip
          prop="itemName"
          label="套餐项目名称"
          width="150px"
        ></el-table-column>
<!--        <el-table-column-->

<!--          show-overflow-tooltip-->
<!--          prop="dailyNumberOfCare"-->
<!--          label="套餐项目日护理次数"-->
<!--          width="150px"-->
<!--        ></el-table-column>-->
<!--        <el-table-column-->

<!--          show-overflow-tooltip-->
<!--          prop="monthNumberOfCare"-->
<!--          label="套餐项目月护理次数"-->
<!--          width="150px"-->
<!--        ></el-table-column>-->
<!--        <el-table-column-->

<!--          show-overflow-tooltip-->
<!--          prop="totalNumberOfCare"-->
<!--          label="套餐项目总护理次数"-->
<!--          width="150px"-->
<!--        ></el-table-column>-->
        <el-table-column label="启用/禁用套餐" prop="disabled" width="300px">
          <template slot-scope="scope">

            <el-switch
              v-model="scope.row.disabled"
              class="demo"
              active-color="#F04134"
              active-text="禁用"
              font-size="12px"
              inactive-color="#11CED2"
              inactive-text="启用"
              @change="switchChange(scope.row)"

            />

          </template>
        </el-table-column>
<!--        <el-table-column-->
<!--          show-overflow-tooltip-->
<!--          label="操作"-->
<!--          width="200px"-->

<!--        >-->
<!--          <template slot-scope="scope">-->

<!--            <el-button type="text"    @click="resvisecs(scope.row)">修改入住项目 <i class="el-icon-edit"></i></el-button>-->


<!--          </template>-->
<!--        </el-table-column>-->
      </el-table>
<!--      <el-table-->
<!--        class="button"-->
<!--        v-loading="listLoading"-->
<!--        :data="tcinfo"-->
<!--        ref="tableSort"-->
<!--      >-->

<!--        <el-table-column-->
<!--          show-overflow-tooltip-->
<!--          label="套餐名称"-->
<!--          width="150px"-->
<!--          prop="name"-->
<!--        ></el-table-column>-->
<!--        <el-table-column-->
<!--          show-overflow-tooltip-->
<!--          prop="dailyFee"-->
<!--          label="套餐日费用"-->
<!--          width="150px"-->
<!--        ></el-table-column>-->
<!--        <el-table-column-->

<!--          show-overflow-tooltip-->
<!--          prop="monthFee"-->
<!--          label="套餐月费用"-->
<!--          width="150px"-->
<!--        ></el-table-column>-->
<!--        <el-table-column-->

<!--          show-overflow-tooltip-->
<!--          prop="itemName"-->
<!--          label="套餐项目名称"-->
<!--          width="150px"-->
<!--        >-->

<!--          <template slot-scope="scope"  >-->
<!--            <div  v-for="(item,index) in scope.row.items">-->
<!--            <span>-->
<!--               {{item.itemName}}-->
<!--            </span>-->
<!--            </div>-->
<!--          </template>-->


<!--        </el-table-column>-->
<!--        <el-table-column-->

<!--          show-overflow-tooltip-->
<!--          prop="itemName"-->
<!--          label="套餐项目日护理次数"-->
<!--          width="150px"-->
<!--        >-->

<!--          <template slot-scope="scope"  >-->
<!--            <div  v-for="(item,index) in scope.row.items">-->
<!--            <span>-->
<!--               {{item.dailyNumberOfCare}}-->
<!--            </span>-->
<!--            </div>-->
<!--          </template>-->


<!--        </el-table-column>-->
<!--        <el-table-column-->

<!--          show-overflow-tooltip-->
<!--          prop="itemName"-->
<!--          label="套餐项目月护理次数"-->
<!--          width="150px"-->
<!--        >-->

<!--          <template slot-scope="scope"  >-->
<!--            <div  v-for="(item,index) in scope.row.items">-->
<!--            <span>-->
<!--               {{item.monthNumberOfCare}}-->
<!--            </span>-->
<!--            </div>-->
<!--          </template>-->


<!--        </el-table-column>-->
<!--        <el-table-column-->

<!--          show-overflow-tooltip-->
<!--          prop="itemName"-->
<!--          label="套餐项目总护理次数"-->
<!--          width="150px"-->
<!--        >-->

<!--          <template slot-scope="scope"  >-->
<!--            <div  v-for="(item,index) in scope.row.items">-->
<!--            <span>-->
<!--               {{item.totalNumberOfCare}}-->
<!--            </span>-->
<!--            </div>-->
<!--          </template>-->


<!--        </el-table-column>-->
<!--&lt;!&ndash;        <el-table-column&ndash;&gt;-->

<!--&lt;!&ndash;          show-overflow-tooltip&ndash;&gt;-->
<!--&lt;!&ndash;          prop="dailyNumberOfCare"&ndash;&gt;-->
<!--&lt;!&ndash;          label="套餐项目日护理次数"&ndash;&gt;-->
<!--&lt;!&ndash;          width="150px"&ndash;&gt;-->
<!--&lt;!&ndash;        ></el-table-column>&ndash;&gt;-->
<!--&lt;!&ndash;        <el-table-column&ndash;&gt;-->

<!--&lt;!&ndash;          show-overflow-tooltip&ndash;&gt;-->
<!--&lt;!&ndash;          prop="monthNumberOfCare"&ndash;&gt;-->
<!--&lt;!&ndash;          label="套餐项目月护理次数"&ndash;&gt;-->
<!--&lt;!&ndash;          width="150px"&ndash;&gt;-->
<!--&lt;!&ndash;        ></el-table-column>&ndash;&gt;-->
<!--&lt;!&ndash;        <el-table-column&ndash;&gt;-->

<!--&lt;!&ndash;          show-overflow-tooltip&ndash;&gt;-->
<!--&lt;!&ndash;          prop="totalNumberOfCare"&ndash;&gt;-->
<!--&lt;!&ndash;          label="套餐项目总护理次数"&ndash;&gt;-->
<!--&lt;!&ndash;          width="150px"&ndash;&gt;-->
<!--&lt;!&ndash;        ></el-table-column>&ndash;&gt;-->
<!--&lt;!&ndash;        <el-table-column label="启用/禁用套餐" prop="disabled" width="200px">&ndash;&gt;-->
<!--&lt;!&ndash;          <template slot-scope="scope">&ndash;&gt;-->

<!--&lt;!&ndash;            <el-switch&ndash;&gt;-->
<!--&lt;!&ndash;              v-model="scope.row.disabled"&ndash;&gt;-->
<!--&lt;!&ndash;              class="demo"&ndash;&gt;-->
<!--&lt;!&ndash;              active-color="#F04134"&ndash;&gt;-->
<!--&lt;!&ndash;              active-text="禁用"&ndash;&gt;-->
<!--&lt;!&ndash;              font-size="12px"&ndash;&gt;-->
<!--&lt;!&ndash;              inactive-color="#11CED2"&ndash;&gt;-->
<!--&lt;!&ndash;              inactive-text="启用"&ndash;&gt;-->
<!--&lt;!&ndash;              @change="switchChange(scope.row)"&ndash;&gt;-->

<!--&lt;!&ndash;            />&ndash;&gt;-->

<!--&lt;!&ndash;          </template>&ndash;&gt;-->
<!--&lt;!&ndash;        </el-table-column>&ndash;&gt;-->
<!--&lt;!&ndash;        <el-table-column&ndash;&gt;-->
<!--&lt;!&ndash;          show-overflow-tooltip&ndash;&gt;-->
<!--&lt;!&ndash;          label="操作"&ndash;&gt;-->
<!--&lt;!&ndash;          width="200px"&ndash;&gt;-->

<!--&lt;!&ndash;        >&ndash;&gt;-->
<!--&lt;!&ndash;          <template slot-scope="scope">&ndash;&gt;-->

<!--&lt;!&ndash;            <el-button type="text"    @click="resvisecs(scope.row)">修改入住项目 <i class="el-icon-edit"></i></el-button>&ndash;&gt;-->


<!--&lt;!&ndash;          </template>&ndash;&gt;-->
<!--&lt;!&ndash;        </el-table-column>&ndash;&gt;-->
<!--      </el-table>-->
    </el-dialog>
    <AccountDetail ref="info" ></AccountDetail>
    <revisetc ref="tcxq"></revisetc>
    <revisejg ref="tcjg"></revisejg>
    <replacemeal ref="rep"></replacemeal>
    <moveinfo ref="moveinfo"></moveinfo>
  </div>
</template>

<script>
    import calendar from 'solarday2lunarday'
    import { searchrecordCode } from "@/api/reserve"

    import { regionDataPlus} from 'element-china-area-data'
    import { searchstor } from "@/api/reserve"
    import { searchtcinfo } from "@/api/moveset"
    import { searchCareLevelbyInste,searchelder } from "@/api/moveset"
    import { searchmnemonicCodeOrName } from "@/api/moveset"
    import { disablePackageItem } from "@/api/moveset"
    import { enablePackageItem } from "@/api/moveset"
    import { searchOfPackageOfConditions,checkinmanager } from "@/api/moveset"
    import {searchroom} from "../../api/reserve";
    import {searchbed} from "../../api/reserve";
    import {updata, addupdata} from "../../api/moveset";
    import {add} from "../../api/moveset";
    import {Stay} from "../../api/moveset";
    import {search} from "../../api/moveset";
    import { parseTime} from "@/utils/index";
    import revisetc  from "./compontent/revisetc";
    import moveinfo  from "./compontent/moveinfo";
    import revisejg  from "./compontent/revisejg";
    import AccountDetail  from "@/views/feemanager/account/components/AccountDetail";
    import replacemeal  from "./compontent/replacemeal";
    import { searchRecentSelfCare,searchElderlyOfCheckInStatus,searchrole } from "@/api/moveset"
    import {startSelfCareEvaluationRecord,addAssessmentOfActivitiesOfDailyLiving,addMentalStateAssessment,addPerceptionAndCommunicationAssessment,addSocialParticipationAssessment,searchinitAssessmentReport,addAssessmentReport,searchSelfCareEvaluationRecordsOfPage,searchSelfCareEvaluationRecordVO}from "@/api/assessmentRecord"
    import { addSelfCareEvaluationRecord,  searchRecentSelfCareEvaluationRecord} from "@/api/assessmentRecord"
    import Template from "../nursing/template";
    import Print from '@/utils/print'
    import Vue from 'vue'
    Vue.use(Print)

    export default {
        name: "movesets",
      filters:{
        parseTime:parseTime
       },

        components: {Template, revisetc,revisejg,replacemeal,AccountDetail,moveinfo},
        data(){

            return{
                equipmentVisibles: false,
                equipmentForm: {
                  type: '',
                  id: '',
                },
                typeList: [
                  { label: '睡眠监测带', value: 1, },
                  { label: '心率监测仪', value: 2, }
                ],
                isassessmentform:false,
                fraction:0,
                isdisabled:false,
                checkedInStatuss:[
                    { label: '全部', value: 2, },
                    { label: '入住中', value: 0, },
                    { label: '已退住', value: 1, },


                ],
                number:"",
                numbers:"",
                tableData:[],
                assessmentform: {
                    bedChairTransferScore: '',
                    decorateScore: '',
                    downStairsScore: '',
                    eatScore: '',
                    gardScore:'',
                    goToiletScore:'',
                    laveScore:'',
                    stoolScore:'',
                    urineScore:'',
                    totalScore:"",
                    walkingOnFlatGroundScore:'',
                    grade:'',
                    number:"",
                },
                planRules: {
                    bedChairTransferScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                    decorateScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                    downStairsScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                    eatScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                    walkingOnFlatGroundScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                    gardScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                    goToiletScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                    laveScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                    stoolScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                    urineScore: [
                        { required: true, message: '请选择选项', trigger: 'change' }
                    ],
                },
                spiritfraction:0,
                spiritRules: {
                    aggressiveBehaviorScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],
                    cognitiveAbilityScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],
                    depressionSymptomsScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],


                },
                spirit:{
                    aggressiveBehaviorScore: '',
                    cognitiveAbilityScore: '',
                    depressionSymptomsScore: '',
                    grade: '',
                    number:"",
                    totalScore:"",

                },
                perceptionRules: {
                    communicationScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],
                    hearingScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],
                    levelOfConsciousnessScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],
                    visionScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],


                },
                perception:{
                    communicationScore: '',
                    hearingScore: '',
                    levelOfConsciousnessScore: '',
                    visionScore: '',
                    grade: '',
                    number:"",

                },
                societyfraction:0,
                societyRules: {
                    abilityToWorkScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],
                    characterOrientationScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],
                    socialSkillsScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],
                    spatialOrientationScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],
                    survivalSkillsScore: [
                        {required: true, message: '请选择选项', trigger: 'change'}
                    ],

                },
                society:{
                    abilityToWorkScore: '',
                    characterOrientationScore: '',
                    socialSkillsScore: '',
                    spatialOrientationScore: '',
                    survivalSkillsScore: '',
                    grade: '',
                    number:'',
                    totalScore:"",
                },
                ability:{
                    adAssessmentGrade:"",
                    abilityFinalLevel:"",
                    abilityInitialLevel:"",
                    changeClause:'',
                    msAssessmentGrade:"",
                    pcAssessmentGrade:"",
                    spAssessmentGrade:"",
                    number:"",
                },
                selfCareAbilityAssessmentReport:{

                },
                activeElderlyRow: {},
                Assessmentinformation:{
                    elderlyName:"",
                    liveAdress:{
                        city:"",//市
                        county:"",//县/区
                        province:"",//省份
                        xxaddress:"",//详细地址
                    },
                    evaluationType:1,//评估类别
                    evaluationTypeName:"",
                    evaluationDate:new Date(),//评估日期
                    elderlyCode:"",
                    evaluationor:""//评估员
                },

                isprev:false,
                pocketbooks:{

                },
                habitHospitalWays:{

                },
                haveCertificates:[{
                    value:true,
                    label:"是",

                },
                    {
                        value: false,
                        label: '否'
                    }
                ],
                clickflage:false,
                innerVisibles:false,
                tcinfo:{},
                position: 0,
                rowSpanArr: [],
                evaluationors:{

                },
                diables:false,
                active:1,
                actives:1,
                dictionary:"",
                diseasess:"",
                listLoading:false,
                institutionNumber:"",
                background:true,
                disabled:false,
                id:0,
                total:0,
              checkForm:{
                timeStart:"",
                timeEnd:"",
                institutionNumber:"",
              },

                list:[],
                stamplist:[],
                elderlyCode:"",
                isshow:false,
                provinceAndCity: regionDataPlus,
                selectedOptions: ["370000","370200","370203"],
                selectedOption: ["370000","370200","370203"],
                form:{
                    haveCertificate:false,//是否有残疾证
                    habitHospitalWay:7,//习惯就医方式
                    habitHospitalSite:"",//习惯就医地点
                    mnemonicCode:"",//老人姓名助记码
                    pocketbook:2,//经济来源
                    cardNo:"",
                    elderlyName:"",//老人姓名
                    nationality:"",//国籍
                    elderlyType:"",//老人类型
                    elderlyUsedName:"",//老人曾用名
                    gender:"",//性别
                    cardType:"",
                    medicalInsuranceType:"",
                    institutionNumber:"",//所属机构编号
                    lunarCalendarBirth:"",//农历生日
                    maritalStatus:"",//婚姻状况
                    medicareNumber:"",//医保编号
                    nation:"",//民族
                    politicalStatus:"",//政治面貌
                    purchaseInsurance:"",//是否购买保险
                    religiousBelief:"",//宗教信仰
                    contactNumber:"",//联系电话
                    censusAdress:{
                        city:"370200",//市
                        county:"370203",//县/区
                        province:"370000",//省份
                        xxaddress:"",//详细地址
                    },
                    emergencyContact:{
                        contactName:"",//联系人姓名
                        contactNumber:"",//联系电话
                        relationship:"",//与老人关系
                    },
                    liveAdress:{
                        city:"370200",//市
                        county:"370203",//县/区
                        province:"370000",//省份
                        xxaddress:"",//详细地址
                    }

                },
                value1:"",
              queryForm: {
                currPageNo: 1,
                limit: 8,
                institutionNumber:"",
                  elderlyCode:"",
                  checkedInTimeStart:"",
                  checkedInTimeEnd:"",
                  checkedInStatus:0,
              },
                radio:1,
                value:"100001",
                options: [{
                    value: '100001',
                    label: '居民身份证'
                }, {
                    value: '100002',
                    label: '军人证'
                },
                    {
                        value: '100003',
                        label: '护照'
                    },
                    {
                        value: '100004',
                        label: '户口本'
                    },
                    {
                        value: '100005',
                        label: '外国人永久居留证'
                    },
                    {
                        value: '100006',
                        label: '武警证'
                    },
                    {
                        value: '100007',
                        label: '公章'
                    },
                    {
                        value: '100008',
                        label: '港澳居民来往内地通行证'
                    },
                    {
                        value: '100009',
                        label: '台湾居民来往大陆通行证'
                    },
                    {
                        value: '100010',
                        label: '其他证件'
                    },
                ],
                elderlyType:2,
                elderlyTypes:{

                },
                bridthn:"",
                bridth:"",
                nationality:1,
                nationalitys:{

                },

                nation:1,
                nations:"",
                educationLevel:13,
                educationLevels:{

                },
                politicalStatu:"",
                politicalStatus:13,
                politicalStatuss:{

                },
                religiousBelief:6,
                religiousBeliefs:{

                },
                maritalStatus:2,
                maritalStatuss:{

                },
                medicalInsuranceType:1,
                medicalInsuranceTypes:"",
                relationship:1,
                relationships:{},
                purchaseInsurance:false,
                purchaseInsurances:[{
                    value:true,
                    label:"是",

                },
                    {
                        value: false,
                        label: '否'
                    }
                ],
                // title:"办理入住",
                // dialogFormVisible:false,
                //
                flage:1,
                loading:false,
                value2:"",
                option:[],
                value3:"",
                room:[],
                value4:"",
                bed:[],
                checkInType:"1",
                checkInTypes:[
                  {
                    typeCode:'1',
                    typeName:"长住",

                  },
                  {
                    typeCode: '2',
                    typeName: '短住'
                  },
                  {
                    typeCode: '0',
                    typeName: '试住'
                  }
                ],
                checkedInTime:"",
                startBillingTime:"",
                compartment:"false",
                compartments:[
                    {
                        value:'true',
                        label:"是",

                    },
                    {
                        value: 'false',
                        label: '否'
                    }
                ],
                disableditem:{
                    checkInMark:"",
                    itemMark:"",
                },
                contractExpirationTime:"",
                elderlyCodes:[],
                nursingLevel:"",
                nursingLevels:"",
                projectPackage:"",
                projectPackages:"",
                from:{
                    bedInfo:
                        {
                            bedNumber:"",//床位编号
                            buildingNumber:"",//楼宇编号
                            floor:"",//楼层
                            institutionNumber:"",//所属机构编号
                            roomNumber:"",//房间编号
                            unit:"",//单元


                         }
                    ,
                    institutionName:"",
                    checkInOrganNumber:"",//入住机构编号
                    checkInType:1,//入住类型
                    checkedInTime:"",//入住日期
                    compartment:false,//是否包房
                    contractExpirationTime:"",//合同到期时间
                    contractNo:"",//合同编号
                    destineCode:"",//入住预约编号(老人已有预约的情况下)
                    elderlyCode:"",//老人编号
                    nursingLevel:"",//护理级别
                    projectPackage:"",//入住套餐
                    remark:"",//备注
                    startBillingTime:"",//开始计费日期
                    elderlyName:"",

                },
                checkInMark:""
            }
        },

        created(){

            this.dictionary=JSON.parse(localStorage.getItem("dictionary"))
            for(var i=0;i<this.dictionary.length;i++){
                if(this.dictionary[i].mark=="nationality"){

                    this.nationalitys=(this.dictionary[i].childs)

                }else if(this.dictionary[i].mark=="nation"){
                    this.nations=(this.dictionary[i].childs)
                }else if(this.dictionary[i].mark=="politicalStatus"){
                    this.politicalStatuss=(this.dictionary[i].childs)
                    this.politicalStatus=this.dictionary[i].childs[12].dcNo
                    this.politicalStatu=this.dictionary[i].childs[12].dcNo
                }else if(this.dictionary[i].mark=="maritalStatus"){
                    this.maritalStatuss=(this.dictionary[i].childs)
                }else if(this.dictionary[i].mark=="relationship"){
                    this.relationships=(this.dictionary[i].childs)
                }else if(this.dictionary[i].mark=="elderlyType"){
                    this.elderlyTypes=(this.dictionary[i].childs)
                }else if(this.dictionary[i].mark=="religiousBelief"){
                    this.religiousBeliefs=(this.dictionary[i].childs)
                }else if(this.dictionary[i].mark=="educationLevel"){
                    this.educationLevels=(this.dictionary[i].childs)
                }else if(this.dictionary[i].mark=="medicalInsuranceType"){
                    this.medicalInsuranceTypes=(this.dictionary[i].childs)
                }else if(this.dictionary[i].mark=="pocketbook"){
                    this.pocketbooks=(this.dictionary[i].childs)

                }else if(this.dictionary[i].mark=="hospitalway"){
                    this.habitHospitalWays=(this.dictionary[i].childs)

                }
            }
            this.checkForm.institutionNumber=localStorage.getItem("institutionNumber")
            this.institutionNumber=localStorage.getItem("institutionNumber")
            //
            // setTimeout(() => {
            //     this.options= JSON.parse(localStorage.getItem("childinstitutionNumber"));
            // }, 1000);
            this.search()
            this.searchrole()
        },
        mounted() {
            this.isshow=false

        },
        activated(){

            if(this.$route.params.id==2){

                      let elderlyCode=this.$route.params.code
                       this.form.elderlyCode=this.$route.params.code
                       this.from.elderlyName=this.$route.params.name
                searchRecentSelfCare({elderlyCode}).then(res => {

                    this.active=2
                        if(res.data){
                            this.selfCareAbilityAssessmentReport=res.data[0].selfCareAbilityAssessmentReport
                            // console.log(this.selfCareAbilityAssessmentReport)
                            this.isassessmentform=true


                            //     this.from.institutionName=this.$route.params.institutionName
                            //
                            //
                            //
                            //
                            //  this.next()
                            // this.from.elderlyName=this.$route.params.name
                            // console.log(this.from.elderlyName)

                        }else {
                            this.isassessmentform=false
                            this.Assessmentinformation.elderlyCode=this.$route.params.code
                            this.Assessmentinformation.elderlyName=this.$route.params.name
                            console.log(this.$route.params.code,this.$route.params.name,this.$route.params.liveAdress)
                            this.Assessmentinformation.liveAdress=this.$route.params.liveAdress
                            let liveAdress=[this.$route.params.liveAdress.province,this.$route.params.liveAdress.city,this.$route.params.liveAdress.county]
                            console.log(liveAdress)
                            this.selectedOption = liveAdress



                        }
                    })
                this.isprev=true
                this.clickflage=true
                this.isshow=true
                // this.from.receptionCode=""
            }else if(this.$route.params.id==1){


                this.active=1
                this.isshow=true

                this.clickflage=false


                  if(this.$route.params.flage){

                      // this.form.elderlyCode=this.$route.params.elderlyCode
                      this.from.destineCode=this.$route.params.destineCode
                      this.from.receptionCode=this.$route.params.receptionCode
                      console.log(this.$route.params.data[0])
                      let consultant=this.$route.params.data[0].emergencyContact.contactNumber
                      searchrecordCode({consultant}).then(res =>{
                          console.log(res.data)
                          this.tableData=res.data





                      })
                      this.form={
                          ...this.$route.params.data[0]
                      }
                      this.elderlyName=this.$route.params.data[0].elderlyName
                      this.elderlyCode=this.$route.params.data[0].elderlyName
                      this.radio = this.$route.params.data[0].gender
                      this.religiousBelief = this.$route.params.data[0].religiousBelief
                      this.elderlyType = this.$route.params.data[0].elderlyType
                      this.medicalInsuranceType = this.$route.params.data[0].medicalInsuranceType
                      this.nationality = this.$route.params.data[0].nationality
                      this.politicalStatus = this.$route.params.data[0].politicalStatus
                      this.nation = this.$route.params.data[0].nation
                      this.maritalStatus = this.$route.params.data[0].maritalStatus
                      this.educationLevel = this.$route.params.data[0].educationLevel
                      this.bridth = this.$route.params.data[0].birth
                      this.bridthn = this.$route.params.data[0].lunarCalendarBirth
                      this.relationship = this.$route.params.data[0].emergencyContact.relationship
                      let censusAdress=[this.$route.params.data[0].censusAdress.province,this.$route.params.data[0].censusAdress.city,this.$route.params.data[0].censusAdress.county]
                      this.selectedOptions = censusAdress
                      let liveAdress=[this.$route.params.data[0].liveAdress.province,this.$route.params.data[0].liveAdress.city,this.$route.params.data[0].liveAdress.county]
                      this.selectedOption = liveAdress

                  }else {
                      console.log(this.$route.params);
                      this.from.destineCode=this.$route.params.destineCode
                      this.from.receptionCode=this.$route.params.receptionCode
                      this.form= {
                          liveAdress:{
                              city:"370200",//市
                              county:"370203",//县/区
                              province:"370000",//省份
                              xxaddress:"",//详细地址
                          },
                          censusAdress:{
                              city:"370200",//市
                              county:"370203",//县/区
                              province:"370000",//省份
                              xxaddress:"",//详细地址
                          },
                          emergencyContact:{
                              contactName:this.$route.params.bookerName,//联系人姓名
                              contactNumber:this.$route.params.contactNumber,//联系电话
                              relationship:"",//与老人关系
                          },
                          haveCertificate:false,//是否有残疾证
                          habitHospitalWay:7,//习惯就医方式
                          habitHospitalSite:"",//习惯就医地点
                          mnemonicCode:"",//老人姓名助记码
                          pocketbook:2,//经济来源
                          cardNo: this.$route.params.elderlyCardNo,
                          elderlyName: "",//老人姓名
                          nationality: "",//国籍
                          elderlyType: "",//老人类型
                          elderlyUsedName: "",//老人曾用名
                          gender: "",//性别
                          cardType: "",
                          medicalInsuranceType: "",
                          institutionNumber: "",//所属机构编号
                          lunarCalendarBirth: "",//农历生日
                          maritalStatus: "",//婚姻状况
                          medicareNumber: "",//医保编号
                          nation: "",//民族
                          politicalStatus: "",//政治面貌
                          purchaseInsurance: "",//是否购买保险
                          religiousBelief: "",//宗教信仰
                          contactNumber: "",//联系电话

                      }
                      this.elderlyName=this.$route.params.name
                      this.elderlyCode=this.$route.params.name

                      this.religiousBelief = 6
                      this.elderlyType = 2
                      this.medicalInsuranceType = 1
                      this.nationality = 1
                      this.politicalStatus = 13
                      this.nation = 1
                      this.maritalStatus = 2
                      this.educationLevel = 13
                      this.bridth = this.$route.params.elderlyBirth
                      this.bridthn = ""
                      this.relationship = this.$route.params.relationship
                      this.purchaseInsurance=false
                      this.selectedOptions=["370000","370200","370203"],
                          this.selectedOption=["370000","370200","370203"],
                          this.changetime(this.$route.params.elderlyBirth)

                      this.cardType = ""
                      this.form.id=0
                      let consultant=this.$route.params.contactNumber
                      searchrecordCode({consultant}).then(res =>{
                          console.log(res.data)
                          this.tableData=res.data





                      })
                      this.setCurrent()
                  }
            }
        },

        methods:{
            searchrole(){

                let institutionNumber=JSON.parse(localStorage.getItem("institutionNumber"));
                searchrole({institutionNumber}).then(res =>{
                    console.log(res)
                    this.evaluationors = res.data

                    this.Assessmentinformation.evaluationor=localStorage.getItem("username")


                })
            },
             //合并表格
            objectSpanMethod({ row, column, rowIndex, columnIndex }) {
                // 只合并区域位置
                if (columnIndex === 0 || columnIndex===1 || columnIndex===2) {

                    const _row = this.rowSpanArr[rowIndex];

                    return {
                        rowspan: _row, //行
                        colspan: 1 //列
                    };
                }

            },
            getRowSpan() {

                this.rowSpanArr = [];
                this.tcinfo.items.forEach((item, index) => {
                    if (index == 0) {
                        this.rowSpanArr.push(1);
                        this.position = 0;
                    } else {
                        if ( this.tcinfo.items[index].name ==  this.tcinfo.items[index - 1].name  ) {
                            this.rowSpanArr[this.position] += 1; //项目名称相同，合并到同一个数组中
                            this.rowSpanArr.push(0);
                            this.tcinfo.items[index].name =  this.tcinfo.items[index - 1].name;

                        }

                        else {

                            this.rowSpanArr.push(1);
                            this.position = index;
                        }
                    }
                });

            },

            changetime(value){
                let  year=calendar.solar2lunar(value).lunarYear
                let  month=calendar.solar2lunar(value).lunarMonth
                let day =calendar.solar2lunar(value).lunarDay
                if(month<10){
                    month='0'+month
                }
                if(day<10){
                    day='0'+day
                }
                let time= (year+'-'+month+'-'+day)
                this.form.lunarCalendarBirth=time
            },





            resvisecs(index){
                     this.$refs["tcxq"].showEdit(index);
            },
            nextpage(){

                document.documentElement.scrollTop=0
                if(this.actives==1){
                    console.log(this.Assessmentinformation)
                    startSelfCareEvaluationRecord(this.Assessmentinformation).then(res =>{
                        console.log(res.data)
                        this.number=res.data
                        this.actives=2


                    })

                }else if(this.actives==2){

                    this.$refs['assessmentform'].validate((valid) => {
                        if (valid) {

                            this.assessmentform.totalScore=this.fraction

                              this.assessmentform.number= this.number
                             addAssessmentOfActivitiesOfDailyLiving(this.assessmentform).then(res =>{
                                 console.log(res)

                                this.actives=3


                             })


                        }else {
                            this.$message({
                                message: '有选项没选，请检查选项哦',
                                type: 'warning'
                            });
                        }
                    })
                }else if(this.actives==3){

                    this.$refs['spirit'].validate((valid) => {
                        if (valid) {

                            this.spirit.totalScore=this.spiritfraction

                            this.spirit.number= this.number
                            addMentalStateAssessment(this.spirit).then(res =>{
                                console.log(res)

                            this.actives=4


                            })


                        }else {
                            this.$message({
                                message: '有选项没选，请检查选项哦',
                                type: 'warning'
                            });
                        }
                    })
                }else if(this.actives==4){
                    this.$refs['perception'].validate((valid) => {
                        if (valid) {


                            this.perception.number= this.number

                            addPerceptionAndCommunicationAssessment(this.perception).then(res =>{
                                            console.log(res)
                                            this.actives=5

                                        })






                        }else {
                            this.$message({
                                message: '有选项没选，请检查选项哦',
                                type: 'warning'
                            });
                        }
                    })
                }else if(this.actives==5){

                    this.$refs['society'].validate((valid) => {
                        if (valid) {
                             this.society.number= this.number
                            this.society.totalScore=this.societyfraction
                            addSocialParticipationAssessment(this.society).then(res =>{
                                console.log(res)
                                this.actives=6
                                if(res.code==200){
                                    let number= this.number
                                    searchinitAssessmentReport({number}).then(res =>{
                                        console.log(res)
                                        this.ability=res.data
                                        if(res.data.abilityInitialLevel==3){
                                            this.isdisabled=true
                                        }else {
                                            this.ability.abilityFinalLevel=res.data.abilityInitialLevel
                                            this.isdisabled=false
                                        }


                                    })

                                }



                            })
                        }else {

                        }
                    })
                }


            },
            prevpage(){

                document.documentElement.scrollTop=0
                if(this.actives==2){
                    this.$baseConfirm("你确定要返回吗？再次进入将进行新的评估", null, async () => {
                        this.actives=1

                        this.initForm()
                        this.initspirit()
                        this.initperception()
                        this.initsociety()
                    })
                }else if(this.actives--<3){
                     return false
                }

            },
            prev(){
                --this.active
                if(this.active<=1){
                    this.active=1
                    this.clickflage=false
                    let elderlyCode=this.form.elderlyCode
                    searchelder({elderlyCode}).then(res => {

                        this.purchaseInsurance=res.data.purchaseInsurance
                        this.elderlyCode=res.data.elderlyName
                        this.form=res.data
                        this.radio = res.data.gender
                        this.religiousBelief = res.data.religiousBelief
                        this.elderlyType = res.data.elderlyType
                        this.medicalInsuranceType = res.data.medicalInsuranceType
                        this.nationality = res.data.nationality
                        this.politicalStatus = res.data.politicalStatus
                        this.nation = res.data.nation
                        this.maritalStatus = res.data.maritalStatus
                        this.educationLevel = res.data.educationLevel
                        this.bridth = res.data.birth
                        this.bridthn = res.data.lunarCalendarBirth
                         this.relationship =res.data.emergencyContact.relationship
                        let censusAdress=[res.data.censusAdress.province,res.data.censusAdress.city,res.data.censusAdress.county]
                        this.selectedOptions = censusAdress
                        let liveAdress=[res.data.liveAdress.province,res.data.liveAdress.city,res.data.liveAdress.county]
                        this.selectedOption = liveAdress

                        this.value = res.data.cardType + ''
                        let consultant=res.data.emergencyContact.contactNumber
                        searchrecordCode({consultant}).then(res =>{
                            console.log(res.data)
                            this.tableData=res.data





                        })

                    })
                }
            },
            // handlerevise(index,row) {
            //
            //     this.$refs["tcxq"].showEdit(row);
            // },
            handlerevisejg(index,row) {


                this.$refs["tcjg"].showEdit(row);
            },
            replacemeal(index,row){
                this.$refs["rep"].showEdit(row);
            },
            handlenrzinfo(index,row){
                this.$refs["moveinfo"].showEdit(row);
            },
            searchRecentSelfCare(){
                let elderlyCode=this.form.elderlyCode
                searchRecentSelfCare({elderlyCode}).then(res => {
                    if(res.data){

                         this.selfCareAbilityAssessmentReport=res.data[0].selfCareAbilityAssessmentReport
                        // console.log(this.selfCareAbilityAssessmentReport)
                        this.isassessmentform=true
                      this.active=2

                    }else {
                        this.active=2
                        this.isassessmentform=false

                    }



                })
            },
            addase(){
                console.log(this.ability)
                this.ability.number=this.number
                addAssessmentReport(this.ability).then(res =>{
                    console.log(res)
                    this.active=3



                })

            },
            reque(){

                this.$baseConfirm("你确定要进行下一步？", null, async () => {

                  this.form.religiousBelief = this.religiousBelief
                  this.form.elderlyType = this.elderlyType
                  this.form.medicalInsuranceType = this.medicalInsuranceType
                  this.form.nationality = this.nationality
                  this.form.politicalStatus = this.politicalStatus
                  this.form.nation = this.nation
                  this.form.maritalStatus = this.maritalStatus
                  this.form.educationLevel = this.educationLevel
                  this.form.bridth = this.bridth
                  // this.form.lunarCalendarBirth = this.bridthn
                    this.form.emergencyContact.relationship = this.relationship
                  this.form.purchaseInsurance = this.purchaseInsurance
                  this.form.selectedOptions = this.selectedOptions
                  this.form.selectedOption = this.selectedOption
                  this.form.cardType = this.value
                  this.form.institutionNumber = this.institutionNumber
                  this.form.gender = this.radio
                  this.form.birth = this.bridth

                    console.log(this.form)
                    this.Assessmentinformation.elderlyCode=this.form.elderlyCode
                    this.Assessmentinformation.elderlyName=this.form.elderlyName
                    this.Assessmentinformation.liveAdress=this.form.liveAdress
                    let liveAdress=[this.form.liveAdress.province,this.form.liveAdress.city,this.form.liveAdress.county]
                    this.selectedOption = liveAdress
                  if(this.form.id){
                      let elderlyCode=this.form.elderlyCode
                      console.log(elderlyCode)
                      searchElderlyOfCheckInStatus({elderlyCode}).then(res => {
                          if(res.data==true){
                              this.$message({
                                  message: "老人正在入住，不能再次办理",
                                  type: 'warning'
                              })
                          }else {
                              this.elderlyCodes[0].version++
                              updata(this.form).then(res => {

                                  this.from.elderlyName=this.form.elderlyName

                                  this.from.institutionName=this.form.institutionName
                                  this.active=2

                                  this.next()
                                  this.searchRecentSelfCare()
                                  this.clickflage=true


                              })

                          }

                      })

                  }else{


                      this.form.elderlyName = this.elderlyName
                      this.Assessmentinformation.elderlyName=this.elderlyName

                    addupdata(this.form).then(res => {
                        this.Assessmentinformation.elderlyCode=res.data
                         this.from.elderlyCode = res.data
                         this.form.elderlyCode=res.data
                         this.from.elderlyName=this.form.elderlyName
                         this.from.institutionName=this.form.institutionName
                         this.active=2
                         this.searchRecentSelfCare()
                         this.clickflage=true
                         this.next()


                    })
                  }


                });

            },
            isnext(){
              this.active=3
            },
            next(){





                       // this.from.elderlyName=this.form.elderlyName
                      this.from.institutionName=this.form.institutionName
                      let institutionNumber=this.institutionNumber
                          searchstor({institutionNumber}).then(res =>{
                              this.option=res.data
                              for (var  i=0; res.data.length;i++) {
                                  this.value2 = res.data[i].number
                                  let number=this.value2
                                  let limit=99999
                                  let currPageNo=1
                                  searchroom({number,institutionNumber,limit,currPageNo}).then(res =>{
                                      this.room=res.data.data
                                      for (var  i=0; res.data.data.length;i++) {
                                          this.value3 = res.data.data[i].id
                                          let obj = {};
                                          obj = this.room.find((item)=>{
                                              return item.id === this.value3;

                                          });
                                          this.from.bedInfo.roomNumber=obj.roomCode
                                          this.from.bedInfo.unit=obj.unit
                                          this.from.bedInfo.floor=obj.floor
                                          let roomCode=obj.roomCode
                                          let unit=obj.unit
                                          let floor=obj.floor
                                          searchbed({number,institutionNumber,roomCode,unit,floor}).then(res =>{

                                              for(var i=0;i<res.data.data.length;i++){
                                                   this.value4=res.data.data[i].bedCode
                                                  if(res.data.data[i].status==2){

                                                      res.data.data[i].disableds=true

                                                  }else {

                                                      res.data.data[i].disableds=false


                                                  }

                                              }

                                              this.bed=res.data.data

                                          })
                                          return false
                                      }


                                  })
                                  return false
                              }









                          })

                      // searchtype({institutionNumber}).then(res =>{
                      //     console.log(res)
                      //     this.checkInTypes=res.data
                      //
                      //
                      // })
                console.log(this.selfCareAbilityAssessmentReport)
                if(this.ability.abilityFinalLevel){
                    let assessmentLevel=this.ability.abilityFinalLevel
                    searchCareLevelbyInste({institutionNumber,assessmentLevel}).then(res =>{
                        console.log(res)
                        this.nursingLevels=res.data
                        for(let i=0;i<res.data.length;i++){
                            this.nursingLevel=res.data[i].levelCode
                        }

                    })
                }else if(this.selfCareAbilityAssessmentReport.abilityFinalLevel)
                  {
                    let assessmentLevel=this.selfCareAbilityAssessmentReport.abilityFinalLevel
                    searchCareLevelbyInste({institutionNumber,assessmentLevel}).then(res =>{
                        console.log(res)
                        this.nursingLevels=res.data
                        for(let i=0;i<res.data.length;i++){
                            this.nursingLevel=res.data[i].levelCode
                        }

                    })
                }




                      searchOfPackageOfConditions({institutionNumber}).then(res =>{
                             this.projectPackages=res.data.data
                          for(let i=0;i<res.data.data.length;i++){
                              this.projectPackage=res.data.data[i].mark
                          }

                      })




            },
            // handleAdd(){
            //      this.dialogFormVisible=true
            // },
          search(id){
                if(id==1){
                    this.queryForm.currPageNo=1
                }
              this.queryForm.institutionNumber =this.institutionNumber
            this.listLoading=true
            search(this.queryForm).then(res =>{
               this.list=res.data.data
               this.total=res.data.total
              setTimeout(() => {
                this.listLoading = false;
              }, 500);
            })
              this.checkForm.checkedInStatus=this.queryForm.checkedInStatus
            this.checkForm.checkedInTimeStart=this.queryForm.checkedInTimeStart
            this.checkForm.checkedInTimeEnd=this.queryForm.checkedInTimeEnd
            checkinmanager(this.checkForm).then(res =>{
              this.stamplist=res.data



            })
          },
            remoteMethod(query) {

                if (query !== '') {
                    this.loading = true;
                    let elderlyCondition=query
                    let institutionNumber=this.institutionNumber
                    searchmnemonicCodeOrName({elderlyCondition,institutionNumber}).then(res => {
                         this.elderlyCodes=res.data

                        setTimeout(() => {
                            this.loading = false;
                        }, 500);
                    })
                } else {
                    this.options = [];
                }
            },
            switchChange(index){
                  this.disableditem.checkInMark=index.checkInMark
                this.disableditem.itemMark=index.itemMark
                if(index.disabled==true){

                    disablePackageItem(this.disableditem).then(res => {
                      if(res.code==200){
                          this.$message({
                              message: "禁用成功",
                              type: 'success'
                          })
                      }




                    })


                }else {
                    enablePackageItem(this.disableditem).then(res => {
                        if(res.code==200){
                            this.$message({
                                message: "启用成功",
                                type: 'success'
                            })
                        }




                    })


                }


            },
          stamp(size){
            if(this.stamplist){
              this.$print(this.$refs.print, { size })
            }else {
              this.$baseMessage("当前时间无数据可打印",'warning');
            }
          },
            changestor(value){
                alert(1)
                console.log(value)
                this.value3=""
                this.value4=""
                this.bed=[]
                let institutionNumber=this.institutionNumber
                let number=value
                this.numbers=value
                let limit=99999
                let currPageNo=1
                searchroom({number,institutionNumber,limit,currPageNo}).then(res =>{

                    this.room=res.data.data


                })

            },
            changesroom(value){
                this.value4=""

                this.bed=[]
                let institutionNumber=this.institutionNumber
                let obj = {};
                obj = this.room.find((item)=>{
                    return item.id === value;

                });
                let getName = ''
                getName = obj.roomCode;
                let roomCode=getName
                let unit=obj.unit
                let floor=obj.floor
                let number=obj.number

                this.from.bedInfo.roomNumber=obj.roomCode
                this.from.bedInfo.unit=obj.unit
                this.from.bedInfo.floor=obj.floor

                searchbed({number,institutionNumber,roomCode,unit,floor}).then(res =>{
                    for(var i=0;i<res.data.data.length;i++){
                        if(res.data.data[i].status==2){
                            res.data.data[i].disableds=true

                        }else {
                            res.data.data[i].disableds=false


                        }
                    }
                    if(res.data.data){
                        this.form.floor=res.data.data[0].floor
                        this.form.unit=res.data.data[0].unit

                    }else {

                    }
                    this.bed=res.data.data

                })
            },
            changebed(value){
                let obj = {};
                obj = this.bed.find((item)=>{
                    return item.bedCode === value;
                });
                let getName = ''
                getName = obj.statusName;
                if(getName=="已预订"){

                    this.$baseConfirm("此房间已被预定，你确定要继续使用吗？", null, async () => {

                    });
                }


            },
          Stay(id,row){
            let checkInMark=row.checkInMark

            this.$baseConfirm("你确定要退住吗", null, async () => {
              // const {code, msg } = await Stay(({checkInMark}
              //
              // ))

                Stay({checkInMark}).then(res => {

                        this.$message({
                            message: "退住成功",
                            type: 'success'

                        })
                        this.diables=true
                        this.search();

                    }).catch((err) =>{
                        console.log(err.code)
                    if(err.code==1801){
                        this.$router.push({
                            path: '/feemanager/bill/'+row.checkInMark
                        })
                    }

                    })



            });
          },
            changeelderlyCode(value){
                this.$route.params.id=""
                this.from.destineCode=""
                this.tableData=[]
                var String=typeof value
                if(String=="string"){
                    this.elderlyName = value
                    this.form= {
                        liveAdress:{
                            city:"370200",//市
                            county:"370203",//县/区
                            province:"370000",//省份
                            xxaddress:"",//详细地址
                        },
                        censusAdress:{
                            city:"370200",//市
                            county:"370203",//县/区
                            province:"370000",//省份
                            xxaddress:"",//详细地址
                        },
                        emergencyContact:{
                            contactName:"",//联系人姓名
                            contactNumber:"",//联系电话
                            relationship:"",//与老人关系
                        },
                        haveCertificate:false,//是否有残疾证
                        habitHospitalWay:7,//习惯就医方式
                        habitHospitalSite:"",//习惯就医地点
                        mnemonicCode:"",//老人姓名助记码
                        pocketbook:2,//经济来源
                        cardNo: "",
                        elderlyName: "",//老人姓名
                        nationality: "",//国籍
                        elderlyType: "",//老人类型
                        elderlyUsedName: "",//老人曾用名
                        gender: "",//性别
                        cardType: "",
                        medicalInsuranceType: "",
                        institutionNumber: "",//所属机构编号
                        lunarCalendarBirth: "",//农历生日
                        maritalStatus: "",//婚姻状况
                        medicareNumber: "",//医保编号
                        nation: "",//民族
                        politicalStatus: "",//政治面貌
                        purchaseInsurance: "",//是否购买保险
                        religiousBelief: "",//宗教信仰
                        contactNumber: "",//联系电话

                    }


                    this.religiousBelief = 6
                    this.elderlyType = 2
                    this.medicalInsuranceType = 1
                    this.nationality = 1
                    this.politicalStatus = 13
                    this.nation = 1
                    this.maritalStatus = 2
                    this.educationLevel = 13
                    this.bridth = ""
                    this.bridthn = ""
                    this.relationship = 1
                    this.purchaseInsurance=false
                    this.selectedOptions=["370000","370200","370203"],
                        this.selectedOption=["370000","370200","370203"],

                    this.cardType = ""
                }else {

                    this.purchaseInsurance=value.purchaseInsurance
                    this.form={

                        ...value

                    }
                    let consultant=this.form.emergencyContact.contactNumber
                    searchrecordCode({consultant}).then(res =>{
                        console.log(res.data)
                            if(res.data){
                                this.tableData=res.data
                            }

                            // else {
                            //     let consultant=this.form.emergencyContact.contactName
                            //     searchrecordCode({consultant}).then(res =>{
                            //         this.tableData=res.data
                            //     })
                            // }

                    })
                    this.radio = value.gender
                    this.religiousBelief = value.religiousBelief
                    this.elderlyType = value.elderlyType
                    this.medicalInsuranceType = value.medicalInsuranceType
                    this.nationality = value.nationality
                    this.politicalStatus = value.politicalStatus
                    this.nation = value.nation
                    this.maritalStatus = value.maritalStatus
                    this.educationLevel = value.educationLevel
                    this.bridth = value.birth
                    this.bridthn = value.lunarCalendarBirth
                    this.relationship = value.emergencyContact.relationship
                    let censusAdress=[value.censusAdress.province,value.censusAdress.city,value.censusAdress.county]
                    this.selectedOptions = censusAdress
                    let liveAdress=[value.liveAdress.province,value.liveAdress.city,value.liveAdress.county]
                    this.selectedOption = liveAdress

                    this.value = value.cardType + ''
                }





            },
            handleCurrent(val) {

                this.flage=1
                this.currentRow = val;
                if(this.currentRow){
                    this.from.receptionCode=this.currentRow.code
                    this.relationship=this.currentRow.consultantRelationship
                    this.form.emergencyContact.contactName=this.currentRow.consultantName
                    this.form.emergencyContact.contactNumber=this.currentRow.consultantContactNumber
                    console.log(this.from)
                }

            },

            handleRowClick(){
                this.flage++
                console.log(this.flage)
                if(this.flage===3){

                    this.setCurrent()
                    this.flage=1
                }
            },
            setCurrent(row) {
                console.log(row)
            if(row!=undefined){
                this.relationship=1
                this.form.emergencyContact.contactName=""
                this.form.emergencyContact.contactNumber=""
                this.$refs.singleTable.setCurrentRow(row);
            }


            },
            phone(){

                if(this.form.emergencyContact.contactNumber!==""){
                    let consultant=this.form.emergencyContact.contactNumber
                    searchrecordCode({consultant}).then(res =>{
                        console.log(res.data)
                        this.tableData=res.data


                    })

                }else {
                    if(this.form.emergencyContact.contactName){
                        let consultant=this.form.emergencyContact.contactName
                        searchrecordCode({consultant}).then(res =>{
                            console.log(res.data)
                            this.tableData=res.data


                        })
                    }

                }



            },
            handleChange(value) {

                this.form.liveAdress.province=value[0]
                this.form.liveAdress.county=value[2]
                this.form.liveAdress.city=value[1]
            },
            handleChanges(value) {

                this.form.censusAdress.province=value[0]
                this.form.censusAdress.county=value[2]
                this.form.censusAdress.city=value[1]
            },
          handleAdd(){
                this.active=1
                this.clickflage=false
                 this.isshow=true
                  },
            initability(){
                this.ability={
                    adAssessmentGrade:"",
                    abilityFinalLevel:"",
                    abilityInitialLevel:"",
                    changeClause:[],
                    msAssessmentGrade:"",
                    pcAssessmentGrade:"",
                    spAssessmentGrade:"",
                    number:"",
                }

            },
            initForm(){
                this.assessmentform={
                    bedChairTransferScore: '',
                    decorateScore: '',
                    downStairsScore: '',
                    eatScore: '',
                    gardScore:'',
                    goToiletScore:'',
                    laveScore:'',
                    stoolScore:'',
                    urineScore:'',
                    totalScore:"",
                    walkingOnFlatGroundScore:'',
                    grade:'',
                    number:"",
                }
            },
            initspirit(){
                this.spirit={
                    aggressiveBehaviorScore: '',
                    cognitiveAbilityScore: '',
                    depressionSymptomsScore: '',
                    grade: '',
                    number:"",
                    totalScore:"",

                }
            },
            initperception(){
                this.perception={
                    communicationScore: '',
                    hearingScore: '',
                    levelOfConsciousnessScore: '',
                    visionScore: '',
                    grade: '',
                    number:"",



                }
            },
            initsociety(){
                this.society={
                    abilityToWorkScore: '',
                    characterOrientationScore: '',
                    socialSkillsScore: '',
                    spatialOrientationScore: '',
                    survivalSkillsScore: '',
                    grade: '',
                    number:'',
                    totalScore:"",
                }
            },
            commint(){


                this.from.checkInOrganNumber=this.institutionNumber
                this.from.bedInfo.buildingNumber=this.value2
                this.from.checkInType= this.checkInType
                // this.from.checkedInTime=this.checkedInTime
                this.from.compartment=this.compartment
                // this.from.contractExpirationTime=this.contractExpirationTime

                if(this.$route.params.id==2){

                    this.from.destineCode=""


                     this.from.receptionCode=""
                    this.from.elderlyCode=this.$route.params.code

                }else  {

                    this.from.elderlyCode=this.elderlyCode.elderlyCode
                }
                if(this.$route.params.id==1){
                    this.from.receptionCode=this.$route.params.receptionCode
                    this.from.destineCode=this.$route.params.destineCode

                }else {

                    // this.from.receptionCode=""
                    // this.from.destineCode=""
                }
                this.from.nursingLevel= this.nursingLevel
                // this.from.startBillingTime=this.startBillingTime
                this.from.projectPackage=this.projectPackage
                this.from.bedInfo.institutionNumber=this.institutionNumber
                // this.from.bedInfo.roomNumber=this.value3
                this.from.bedInfo.bedNumber= this.value4





                setTimeout(() => {
                    let elderlyCode=this.form.elderlyCode
                   this.from.elderlyCode= this.form.elderlyCode
                    searchElderlyOfCheckInStatus({elderlyCode}).then(res => {
                        if(res.data==true){
                            this.$message({
                                message: "老人正在入住，不能再次办理",
                                type: 'warning'
                            })
                        }else {
                             let institutionNumber=this.institutionNumber
                            //
                            // searchCareLevelbyInste({institutionNumber}).then(res =>{
                            //     this.nursingLevels=res.data
                            //     for(let i=0;i<res.data.length;i++){
                            //         this.nursingLevel=res.data[i].levelCode
                            //     }
                            //
                            // })
                            searchOfPackageOfConditions({institutionNumber}).then(res =>{
                                this.projectPackages=res.data.data
                                for(let i=0;i<res.data.data.length;i++){
                                    this.projectPackage=res.data.data[i].mark
                                }

                            })

                            console.log(this.from)

                            this.$refs['from'].validate((valid) => {
                                if (valid) {
                                    const loading = this.$loading({
                                        lock: true,
                                        text: '正在办理入住，请稍等',
                                        spinner: 'el-icon-loading',
                                        background: 'rgba(0, 0, 0, 0.7)'
                                    });
                                    add(this.from).then(res =>{



                                        if(res.code==200){

                                            loading.close();
                                            this.$message({
                                                message: "已成功办理入住",
                                                type: 'success'
                                            })
                                            this.$baseConfirm("是否去交押金", null, async () => {
                                                let checkInInfo={checkInMark:res.data}
                                                this.$refs["info"].show(checkInInfo);

                                            })
                                            this.isshow=false
                                            this.active=1
                                            this.actives=1
                                            this.form= {
                                                liveAdress:{
                                                    city:"370200",//市
                                                    county:"370203",//县/区
                                                    province:"370000",//省份
                                                    xxaddress:"",//详细地址
                                                },
                                                censusAdress:{
                                                    city:"370200",//市
                                                    county:"370203",//县/区
                                                    province:"370000",//省份
                                                    xxaddress:"",//详细地址
                                                },
                                                emergencyContact:{
                                                    contactName:"",//联系人姓名
                                                    contactNumber:"",//联系电话
                                                    relationship:"",//与老人关系
                                                },
                                                haveCertificate:false,//是否有残疾证
                                                habitHospitalWay:7,//习惯就医方式
                                                habitHospitalSite:"",//习惯就医地点
                                                mnemonicCode:"",//老人姓名助记码
                                                pocketbook:2,//经济来源
                                                cardNo: "",
                                                elderlyName: "",//老人姓名
                                                nationality: "",//国籍
                                                elderlyType: "",//老人类型
                                                elderlyUsedName: "",//老人曾用名
                                                gender: "",//性别
                                                cardType: "",
                                                medicalInsuranceType: "",
                                                institutionNumber: "",//所属机构编号
                                                lunarCalendarBirth: "",//农历生日
                                                maritalStatus: "",//婚姻状况
                                                medicareNumber: "",//医保编号
                                                nation: "",//民族
                                                politicalStatus: "",//政治面貌
                                                purchaseInsurance: "",//是否购买保险
                                                religiousBelief: "",//宗教信仰
                                                contactNumber: "",//联系电话

                                            }

                                            this.elderlyCode=""
                                            this.religiousBelief = 6
                                            this.elderlyType = 2
                                            this.medicalInsuranceType = 1
                                            this.nationality = 1
                                            this.politicalStatus = 13
                                            this.nation = 1
                                            this.maritalStatus = 2
                                            this.educationLevel = 13
                                            this.bridth = ""
                                            this.bridthn = ""
                                            this.relationship = 1
                                            this.purchaseInsurance=false
                                            this.selectedOptions=["370000","370200","370203"],
                                                this.selectedOption=["370000","370200","370203"],
                                                this.cardType = ""

                                            this.startBillingTime=""
                                            this.contractExpirationTime=""
                                            this.checkedInTime=""
                                            this.checkInType="1"
                                            this.from.contractNo=""
                                            this.from.remark=""
                                            this.compartment="false"
                                            this.from.receptionCode=""

                                            this.initForm()
                                            this.initspirit()
                                            this.initperception()
                                            this.initsociety()
                                            this.search()
                                        }



                                    }).catch(

                                        loading.close()
                                    )
                                } else {

                                    return false;
                                }
                            });

                        }

                    })

                }, 1000);


            },


            handlentcinfo(id,row){
                 this.tcinfo=[]
                this.innerVisibles=true
                let checkInMark=row.checkInMark
                searchtcinfo({checkInMark}).then(res => {

                    this.tcinfo=(res.data)
                    for(var i=0;i<res.data.items.length;i++){
                         res.data.items[i].dailyFee=res.data.dailyFee
                        res.data.items[i].monthFee=res.data.monthFee
                        res.data.items[i].name=res.data.name
                    }
                    this.getRowSpan()



                })
            },
            checkChange(){

                let  number=Number(this.assessmentform.bedChairTransferScore)+Number(this.assessmentform.decorateScore)+Number(this.assessmentform.downStairsScore) +Number(this.assessmentform.eatScore)+Number(this.assessmentform.gardScore)+Number(this.assessmentform.goToiletScore)+Number(this.assessmentform.laveScore)+  Number(this.assessmentform.stoolScore)+Number(this.assessmentform.urineScore)+Number(this.assessmentform.walkingOnFlatGroundScore)
                console.log(number)

                this.fraction=number
                if(number==100){
                    this.assessmentform.grade=0
                }else if(number>=65&&number<=95){
                    this.assessmentform.grade=1
                }else if(number>=45&&number<=60){
                    this.assessmentform.grade=2
                }else if(number<=40){
                    this.assessmentform.grade=3
                }

            },
            checkChangespirit(){
                let  number=Number(this.spirit.aggressiveBehaviorScore)+Number(this.spirit.cognitiveAbilityScore)+Number(this.spirit.depressionSymptomsScore)
                this.spiritfraction=number
                if(number==0){
                    this.spirit.grade=0
                }else if(number==1){
                    this.spirit.grade=1
                }else if(number>=2&&number<=3){
                    this.spirit.grade=2
                }else if(number>=4&&number<=6){
                    this.spirit.grade=3
                }
            },
            checkChangeperception(){
                if(this.perception.visionScore==4 ||this.perception.hearingScore==4 || this.perception.communicationScore==3 || this.perception.levelOfConsciousnessScore==2 ||this.perception.levelOfConsciousnessScore==3) {

                    this.perception.grade = 3

                } else if(this.perception.levelOfConsciousnessScore==0 && this.perception.visionScore==2 ||this.perception.levelOfConsciousnessScore==0 && this.perception.hearingScore==2 ||this.perception.levelOfConsciousnessScore==0 &&this.perception.communicationScore==1){
                    this.perception.grade = 1
                }else if(this.perception.levelOfConsciousnessScore==0 && this.perception.visionScore==3 ||this.perception.levelOfConsciousnessScore==0 && this.perception.hearingScore==3 ||this.perception.levelOfConsciousnessScore==0&&this.perception.communicationScore==2 ||this.perception.levelOfConsciousnessScore==1&&this.perception.visionScore<3&&this.perception.communicationScore<2||this.perception.levelOfConsciousnessScore==1&&this.perception.hearingScore<3&&this.perception.communicationScore<2){
                    this.perception.grade = 2
                }
                else if(this.perception.levelOfConsciousnessScore==0 && this.perception.visionScore==0 || this.perception.visionScore==1|| this.perception.hearingScore==1 ||this.perception.hearingScore==0&&this.perception.communicationScore==0){
                    this.perception.grade = 0
                }



            },
            checkChangesociety(){
                let  number=Number(this.society.abilityToWorkScore)+Number(this.society.characterOrientationScore)+Number(this.society.socialSkillsScore) +Number(this.society.spatialOrientationScore)+Number(this.society.survivalSkillsScore)

                this.societyfraction=number
                if(number>=0&&number<=2){
                    this.society.grade=0
                }else if(number>=3&&number<=7){
                    this.society.grade=1
                }else if(number>=8&&number<=13){
                    this.society.grade=2
                }else if(number>=14&&number<=20){
                    this.society.grade=3
                }
            },
            changeClause(value){

                this.ability.abilityFinalLevel=this.ability.abilityInitialLevel
                if(value==2 || value==1 ){
                    console.log(this.ability.abilityFinalLevel)
                    this.ability.abilityFinalLevel=this.ability.abilityFinalLevel+1
                }
                else if(value==3){
                    this.ability.abilityFinalLevel=3
                }

            },
          handleSizeChange(val) {
            this.queryForm.limit = val;
            this.search();
          },
          handleCurrentChange(val) {

            this.queryForm.currPageNo = val;
            this.search();
          },
            changeTime(value){
                if(this.value1){
                    this.queryForm.checkedInTimeStart=value[0]
                    this.queryForm.checkedInTimeEnd=value[1]
                }else {
                    this.queryForm.checkedInTimeStart=undefined
                    this.queryForm.checkedInTimeEnd=undefined
                }

            },
          back(){
              this.active=1
              this.actives=1
              this.form= {
                  liveAdress:{
                      city:"370200",//市
                      county:"370203",//县/区
                      province:"370000",//省份
                      xxaddress:"",//详细地址
                  },
                  censusAdress:{
                      city:"370200",//市
                      county:"370203",//县/区
                      province:"370000",//省份
                      xxaddress:"",//详细地址
                  },
                  emergencyContact:{
                      contactName:"",//联系人姓名
                      contactNumber:"",//联系电话
                      relationship:"",//与老人关系
                  },
                  haveCertificate:false,//是否有残疾证
                  habitHospitalWay:7,//习惯就医方式
                  habitHospitalSite:"",//习惯就医地点
                  mnemonicCode:"",//老人姓名助记码
                  pocketbook:2,//经济来源
                  cardNo: "",
                  elderlyName: "",//老人姓名
                  nationality: "",//国籍
                  elderlyType: "",//老人类型
                  elderlyUsedName: "",//老人曾用名
                  gender: "",//性别
                  cardType: "",
                  medicalInsuranceType: "",
                  institutionNumber: "",//所属机构编号
                  lunarCalendarBirth: "",//农历生日
                  maritalStatus: "",//婚姻状况
                  medicareNumber: "",//医保编号
                  nation: "",//民族
                  politicalStatus: "",//政治面貌
                  purchaseInsurance: "",//是否购买保险
                  religiousBelief: "",//宗教信仰
                  contactNumber: "",//联系电话

              }

              this.elderlyCode=""
              this.religiousBelief = 6
              this.elderlyType = 2
              this.medicalInsuranceType = 1
              this.nationality = 1
              this.politicalStatus = 13
              this.nation = 1
              this.maritalStatus = 2
              this.educationLevel = 13
              this.bridth = ""
              this.bridthn = ""
              this.relationship = 1
              this.purchaseInsurance=false
              this.selectedOptions=["370000","370200","370203"],
                  this.selectedOption=["370000","370200","370203"],
                  this.cardType = ""

              this.startBillingTime=""
              this.contractExpirationTime=""
              this.checkedInTime=""
              this.checkInType="1"
              this.from.contractNo=""
              this.from.remark=""
              this.compartment="false"

              this.initForm()
              this.initspirit()
              this.initperception()
              this.initsociety()
              this.isshow=false
          },

        },
    }
</script>

<style scoped>
  .table-moveset>>> .el-divider{
    width:85% !important;
    margin-left: 6.3% !important;
  }
  @media only screen and (min-width: 1920px){
    .table-moveset>>> .el-col-xl-10 {
      width: 90.666667% !important;
    }
  }

  @media only screen and (min-width: 1920px){
    .table-moveset>>> .el-col-xl-14 {
      width: 17.666667% !important;
    }
  }

  @media only screen and (min-width: 1200px){
    .table-moveset>>> .el-col-xl-10 {
      width: 84.666667% !important;
    }
  }

  @media only screen and (min-width: 1200px){
    .table-moveset>>> .el-col-xl-14 {
      width: 12.666667% !important;
    }
  }
  .active >>> .el-table__body tr.current-row > td{
    background-color: #409eff !important
  }
  .active >>> .el-table__body tr.current-row > td .cell{
    color: #ffffff !important
  }
  .active >>>.el-table__body tr:hover>td {
    background-color: #409eff !important;
    color: #ffffff;
  }
  .button >>> .demo .el-switch__label {
    position: absolute !important;
    display: none !important;
    color: #fff !important;
  }
  .button >>>.el-switch__core{
    width: 50px !important;
  }
  /*打开时文字位置设置*/
  .button >>> .demo .el-switch__label--right {
    z-index: 1 !important;

  }
  /*关闭时文字位置设置*/
  .button >>> .demo .el-switch__label--left {
    z-index: 1 !important;
    left: 19px !important;
    margin-right: 0px !important;
  }
  /*显示文字*/
  .button >>> .demo .el-switch__label.is-active {
    display: block !important;

  }
  .button >>> .demo .el-switch__label.is-active span{
    font-size: 12px !important;
  }
  .button >>> .demo.el-switch .el-switch__core,
  .el-switch .el-switch__label {
    width: 50px !important !important;
  }
  .font >>> .el-form-item__label{
    font-size: 12px;
  }
  .assess  >>> .el-table .warning-row {background: oldlace;opacity: 0.5;}
  .assess>>> .el-table .success-row {background: #f0f9eb;}
  .tableHeader{padding:20px 10px;}
  .itemRow{display: inline-block;}
  .color >>>.el-form-item__label{
    color: #001529 !important;
  }
  .assess >>> .el-radio__label > span{margin-right: 20px;}
  .assess >>> .el-form-item__label{color: #409EFF;font-weight: 500;font-size: 16px;padding-bottom: 5px;margin-left: -12px;}
  .assess >>> .el-form-item{margin-bottom: 30px;padding-left: 20px;}
  .assess >>> .el-checkbox-group{margin-left: 20px;}
  .assess >>> .rowMain > .el-checkbox-group{line-height: 20px;margin-bottom: 15px;position: relative;top: 12px;margin-left: 0;}
  .tips{padding-bottom: 6px;padding-top: 4px;}
  .tips > div{margin-bottom: 8px;line-height: 20px;}
  .assess >>> .el-radio{display: block;line-height: 24px;}
  .assess >>> .el-checkbox__input.is-disabled + span.el-checkbox__label{color: #606266;}
  .assess>>> .el-checkbox-group{display: inline-block;}
  .assess >>> .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color: #1890ff;}
  .assess >>> .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{border-color: #1890ff;}
  .assess >>> .el-radio__input.is-disabled.is-checked .el-radio__inner:after{border-color: #1890ff;background: #1890ff;}
  .assess>>> .el-radio__input.is-disabled.is-checked .el-radio__inner{border-color: #1890ff;}
  .assess >>> .el-radio__input.is-disabled + span.el-radio__label{color: #606266;}
  .showMask{position: absolute;width: 95%;height: 88%;z-index: 2;}
  .assessmentform {border: 1px solid #ccc;border-bottom: 0;padding: 0;padding-right: 0 !important;}
  .assessmentform .el-form-item {
    margin-bottom: 10px;
    padding-left: 20px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 24px;
  }
  [v-cloak]{
    display: none !important;
  }
  .mytables{
    display: none ;
    padding-top: 10px;

  }
  .mytable
  {

    border-collapse: collapse;
    margin: 0 auto;
    text-align: center;
  }
  .mytable td, table th
  {
    border: 1px solid rgba(59,65,81,.3);
    height: 40px;
  }
  .mytable .ttitle
  {
    background-color: #F5FAFA;
    width: 10%;
  }
  .mytable tr:nth-child(odd)
  {
    background: #fff;
  }
  .mytable .datalist{
    width: 30%;

  }
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 30px;
  }

  .el-aside {
    color: #333;
  }
</style>

